Running cproto on the following program #include <stdio.h> int main() { printf("hello world!\n"); } generates the following errors, on a real program the errors are much worse and are found in many more header files. As far as I can tell the C compiler has no problem parsing any of my code. /* hello.c */ "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h", line 43: parse error at token '__builtin_va_list' Expected: auto bool char complex define-name double enum extension extern ... void "/usr/include/libio.h", line 459: parse error at token '__gnuc_va_list' Expected: ... auto bool char complex define-name double enum extension ... void "/usr/include/libio.h", line 461: parse error at token '__gnuc_va_list' Expected: ... auto bool char complex define-name double enum extension ... void "/usr/include/stdio.h", line 276: parse error at token '__gnuc_va_list' Expected: ... auto bool char complex define-name double enum extension ... void "/usr/include/stdio.h", line 278: parse error at token '__gnuc_va_list' Expected: ... auto bool char complex define-name double enum extension ... void "/usr/include/stdio.h", line 282: parse error at token '__gnuc_va_list' Expected: ... auto bool char complex define-name double enum extension ... void "/usr/include/stdio.h", line 291: parse error at token '__gnuc_va_list' Expected: ... auto bool char complex define-name double enum extension ... void "/usr/include/stdio.h", line 294: parse error at token '__gnuc_va_list' Expected: ... auto bool char complex define-name double enum extension ... void int main(void);
Fixed in cproto-4.6-6, will be in next rawhide release.
*** Bug 21684 has been marked as a duplicate of this bug. ***
As far as I can tell this is not working, at least not for all configs. I get the exact same thing on a RH7.1. The errors appear harmless, but are ugly. Relevant RPMs: gcc-2.96-85 cpp-2.96-85 glibc-2.2.2-10 cproto-4.6-8 (from Rawhide, the default 4.6-7 has the same problem) cproto's config.h does have what the src.rpm changelog suggests as the solution #define CPP "/lib/cpp -U__THROW" There is a different version (4.6d) at ftp://dickey.his.com/cproto, the URL in the src.rpm leads nowhere. That version has the same problem. The problem is a gcc builtin symbol, __builtin_va_list, and it appears that you can shut it up by simply defining that symbol. [... making patch ...] /Urban
Created attachment 23629 [details] Patch for gcc builtins, activate with --enable-gcc-builtins, .spec file not updated