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


On Fri, Jun 23, 2000 at 10:35:17AM -0700, Joe Buck wrote:

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

I do understand and use most of GCC's warnings.

I don't propose changing GCC (or libc, for that matter); I
propose thinking about a way of preventing GCC users who
use functions like erfc, erf, etc. from the pitfalls of
using the -ansi switch.

This switch changes a program which uses erfc from correctly
working into silently malfunctioning, due to the compiler
interpreting the return value of erfc as `int' because of
the absence of a prototype.

Depending on the size and complexity of the program, it can
be quite an undertaking to track that down.

While -ansi suppresses the prototype, it doesn't suppress the
linking against erfc, and so there is no `big difference', as
it can be seen for keywords like `inline', where compilation
just fails.

*****

Since I haven't received any feedback like `me too' from others,
the user base that has fallen into that trap is probably small
and it's probably not worth enhancing GCC/glibc to provide a
more prominent notice to users.

Probably not many people use erf, erfc, hypot, & friends, or if
they do, they are wise enough to stay away from -ansi.

Or they just silently suffer ;)

Regards,

Claus

-- 
claus.fischer@intel.com   Intel Corporation SC12-205 ... not speaking
phone   +1-408-765-6808   2200 Mission College Blvd.           for Intel
fax     +1-408-765-9322   Santa Clara, CA 95052-8119

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