This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Documentation request for -ansi
- To: claus dot fischer at intel dot com (Claus Fischer)
- Subject: Re: Documentation request for -ansi
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Fri, 23 Jun 2000 10:35:17 -0700 (PDT)
- Cc: gcc at gcc dot gnu dot org
> 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).