Documentation request for -ansi
Joe Buck
jbuck@racerx.synopsys.com
Fri Jun 23 10:35:00 GMT 2000
> Users mostly use `-ansi' to find violations of ANSI rules in their
> code (accidental trigraphs in comments ;)). In those cases, they
> probably want non-prototyped functions to fail as well.
But that is not what -ansi means. To get warnings about non-prototyped
functions, add the flag -Wstrict-prototypes.
What -ansi does is turn off any GCC feature that can conflict with ANSI
rules, such as "inline" for C. It also defines the __STRICT_ANSI macro,
which may #ifdef out nonstandard stuff in header files.
> So perhaps -ansi must (legally) remain as it is, and then how can
> we warn the user?
The problem is already solved with the existing compiler.
GCC already has a great deal of flexibility and power in using optional
warnings to diagnose problems; please, no one propose changes without
reading the "Invoking GCC" chapter of the GCC manual (for a quick scan,
just read invoke.texi).
More information about the Gcc
mailing list