This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc3 vs 176.gcc
- From: Joe Buck <jbuck at synopsys dot COM>
- To: jsm28 at cam dot ac dot uk (Joseph S. Myers)
- Cc: jbuck at synopsys dot COM (Joe Buck),rth at redhat dot com (Richard Henderson), geoffk at redhat dot com,dalej at apple dot com, gcc at gcc dot gnu dot org
- Date: Thu, 10 Jan 2002 15:10:25 -0800 (PST)
- Subject: Re: gcc3 vs 176.gcc
I wrote:
> > Maybe this one should be a hard error if -fstrict-aliasing is enabled
> > and optimization is on, as bad code is so highly likely. But there
> > is perhaps a philosophical problem with having a warning become an
> > error based on optimization level.
Joseph Myers writes:
> Making it an error is no good since we don't know that any particular
> function ever gets executed. (You could compile it into a call to
> abort(), though.)
This is an odd way of looking at things. Consider code that accesses
a private data member in C++ without permission. Are you saying that
instead of producing an error, we should produce code that calls abort()
if the code is reached? It's exactly the same sort of thing: the ISO
standard forbids the code in either case.