This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Documentation request for -ansi



> 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).




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]