This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Prec/RFA] fix build error of prec in cygwin
> Date: Fri, 22 May 2009 16:42:06 +0800
> From: Hui Zhu <teawater@gmail.com>
> Cc: gdb-patches@sourceware.org
>
> int
> main(int argc,char *argv[],char *envp[])
> {
> printf ("%uz", sizeof (int));
>
> return (0);
> }
>
> gcc -std=c89 -Wall -pedantic 1.c
>
> No warning.
You are placing too much faith into -std= and -pedantic. From the GCC
manual, node "Warning Options":
Some users try to use `-pedantic' to check programs for strict ISO
C conformance. They soon find that it does not do quite what they
want: it finds some non-ISO practices, but not all--only those for
which ISO C _requires_ a diagnostic, and some others for which
diagnostics have been added.
A feature to report any failure to conform to ISO C might be
useful in some instances, but would require considerable
additional work and would be quite different from `-pedantic'. We
don't have plans to support such a feature in the near future.