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: -ansi vs. V3


On 06-Feb-2001, Tom Leete <tleete@mountain.net> wrote:
> Mark Mitchell wrote:
> > 
> > I've gotten a couple of off-list emails about this.
> > 
> > I'm not sure what to do.  I think the right thing is to have a a
> > different preprocessor spec for C++ than C, so that -ansi can be
> > handled differently in C++.  It turns out that `g++ -ansi' is broken
> > on AIX, OpenServer, and probably some other platforms as well.
> > 
> > Another approach would simply be not to use -ansi in the testsuite
> > when running `make check-g++'.  That might be simplest, in the short
> > term.  Then, everyone could run tests, and it actually makes sense to
> > test the default options most heavily.  Then, if users want to use
> > -ansi, they may find it doesn't work some places -- but they can
> > always fall back to *not* using -ansi.
> > 
> > Thoughts?

I think it would be quite unfortunate if g++ 3.0 is broken in this way.
The worst aspect of it is that since copies of g++ 3.0 will be around
for years, many people will simply stop using `-ansi', rather than
bothering to autoconf it.

Here at the University of Melbourne we teach our students to always
enable `-ansi' (or its equivalent in other compilers) unless they are
making use of non-ANSI/ISO features.

> Strict ansi C++ should require the use of, eg.:
> #include <cstdio>
> rather than
> #include <stdio.h>

Well, perhaps it *should*, but it *doesn't*; the time for making such
arguments essentially finished when the C++ standard was published.
Most people on the C++ committee did not agree with your viewpoint.

> The latter gives trouble on any platform.

Only if the C++ implementation is broken.

(Which is of course exactly the problem here...)

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

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