How to fix ""/usr/include/string.h", line 44: syntax error at token '__dest'" when using cproto

时间:2019-04-17 00:39:43

标签: c gcc cproto

I am compiling a C program on CentOS 6.8 and I see a lot of syntax errors in gcc include header files at token '???', but it can generate the binary eventually.

The cproto version I am using is 4.6 and I have tried gcc 4.4.7 and gcc 5.4. I am confused what went wrong with my /usr/include/*.h. Any help would be really appreciated.

Here is part of the log:

cproto -D__extension__=" "  -DCPROTO -S -f 2 -I. -I/home/XXX/include -o test.pl test.c
"/usr/include/stdarg.h", line 40: syntax error at token '__builtin_va_list'
"/usr/include/libio.h", line 491: syntax error at token '__gnuc_va_list'
"/usr/include/stdio.h", line 197: syntax error at token '__asm__'
"/usr/include/stdio.h", line 282: syntax error at token '__filename'
......
"/usr/include/stdio.h", line 734: syntax error at token '__ptr'
"/usr/include/stdio.h", line 779: syntax error at token '__asm__'
"/usr/include/stdio.h", line 801: syntax error at token '__stream'
"/usr/include/stdio.h", line 803: syntax error at token '__asm__'
"/usr/include/stdlib.h", line 165: syntax error at token '__nptr'
......
"/usr/include/stdlib.h", line 210: syntax error at token '__nptr'
"/usr/include/stdlib.h", line 215: syntax error at token '__nptr'
"/usr/include/sys/select.h", line 109: syntax error at token '__readfds'
"/usr/include/stdlib.h", line 360: syntax error at token '__buf'
"/usr/include/stdlib.h", line 366: syntax error at token '__statebuf'
"/usr/include/stdlib.h", line 371: syntax error at token '__statebuf'
......
"/usr/include/string.h", line 44: syntax error at token '__dest'
"/usr/include/string.h", line 57: syntax error at token '__dest'
......
"/usr/include/fcntl.h", line 209: syntax error at token '__asm__'
"/usr/include/sys/stat.h", line 219: syntax error at token '__file'
"/usr/include/sys/stat.h", line 222: syntax error at token '__asm__'
"/usr/include/sys/stat.h", line 269: syntax error at token '__file'
"/usr/include/sys/stat.h", line 412: syntax error at token '__asm__'
"/usr/include/sys/stat.h", line 415: syntax error at token '__asm__'
"/usr/include/sys/stat.h", line 418: syntax error at token '__asm__'
"/usr/include/sys/stat.h", line 421: syntax error at token '__asm__'
gcc -g -c -m64 -gdwarf-2 -g -D__USE_XOPEN2K8 -std=gnu89 -DTPI_DEBUG -c -I. -I/home/XXX/include ./test.c

0 个答案:

没有答案