Skip to content

Commit a9dca20

Browse files
committed
Improve --use-system-headers output for GCC compatibility
Cleanup of list of known functions; added several C-library internal struct types to avoid their output when the header will be declaring them.
1 parent ad55c4f commit a9dca20

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/goto-instrument/dump_c.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,10 @@ void dump_ct::init_system_library_map()
642642
"pthread_rwlock_unlock", "pthread_rwlock_wrlock",
643643
"pthread_rwlockattr_destroy", "pthread_rwlockattr_getpshared",
644644
"pthread_rwlockattr_init", "pthread_rwlockattr_setpshared",
645-
"pthread_self", "pthread_setspecific"
645+
"pthread_self", "pthread_setspecific",
646+
/* non-public struct types */
647+
"tag-__pthread_internal_list", "tag-__pthread_mutex_s",
648+
"pthread_mutex_t"
646649
};
647650
ADD_TO_SYSTEM_LIBRARY(pthread_syms, "pthread.h");
648651

@@ -667,7 +670,7 @@ void dump_ct::init_system_library_map()
667670
"mkstemp", "mktemp", "perror", "printf", "putc", "putchar",
668671
"puts", "putw", "putwc", "putwchar", "remove", "rewind", "scanf",
669672
"setbuf", "setbuffer", "setlinebuf", "setvbuf", "snprintf",
670-
"sprintf", "sscanf", "strerror", "swprintf", "sys_errlist",
673+
"sprintf", "sscanf", "swprintf", "sys_errlist",
671674
"sys_nerr", "tempnam", "tmpfile", "tmpnam", "ungetc", "ungetwc",
672675
"vasprintf", "vfprintf", "vfscanf", "vfwprintf", "vprintf",
673676
"vscanf", "vsnprintf", "vsprintf", "vsscanf", "vswprintf",
@@ -703,9 +706,9 @@ void dump_ct::init_system_library_map()
703706
const char* time_syms[]=
704707
{
705708
"asctime", "asctime_r", "ctime", "ctime_r", "difftime", "gmtime",
706-
"gmtime_r", "localtime", "localtime_r", "mktime",
709+
"gmtime_r", "localtime", "localtime_r", "mktime", "strftime",
707710
/* non-public struct types */
708-
"tag-timespec", "tag-timeval"
711+
"tag-timespec", "tag-timeval", "tag-tm"
709712
};
710713
ADD_TO_SYSTEM_LIBRARY(time_syms, "time.h");
711714

@@ -726,21 +729,27 @@ void dump_ct::init_system_library_map()
726729
// sys/select.h
727730
const char* sys_select_syms[]=
728731
{
729-
"select"
732+
"select",
733+
/* non-public struct types */
734+
"fd_set"
730735
};
731736
ADD_TO_SYSTEM_LIBRARY(sys_select_syms, "sys/select.h");
732737

733738
// sys/socket.h
734739
const char* sys_socket_syms[]=
735740
{
736-
"accept", "bind", "connect"
741+
"accept", "bind", "connect",
742+
/* non-public struct types */
743+
"tag-sockaddr"
737744
};
738745
ADD_TO_SYSTEM_LIBRARY(sys_socket_syms, "sys/socket.h");
739746

740747
// sys/stat.h
741748
const char* sys_stat_syms[]=
742749
{
743-
"fstat", "lstat", "stat"
750+
"fstat", "lstat", "stat",
751+
/* non-public struct types */
752+
"tag-stat"
744753
};
745754
ADD_TO_SYSTEM_LIBRARY(sys_stat_syms, "sys/stat.h");
746755

0 commit comments

Comments
 (0)