This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -std's (was Re: v3 link failures analyzed)
- To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Subject: Re: -std's (was Re: v3 link failures analyzed)
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 11 Jan 2001 05:56:31 +0100
- Cc: Gabriel Dos Reis <gdr at codesourcery dot com>, <libstdc++ at gcc dot gnu dot org>, <gcc at gcc dot gnu dot org>
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.4.30.0101102132210.15202-100000@kern.srcf.societies.cam.ac.uk>
"Joseph S. Myers" <jsm28@cam.ac.uk> writes:
[...]
| > reasonable to require user to recall the exact spelling. And I don't
| > find it unreasonable to provide a flag select the most recent standard.
| > Isn't it easier to teach that -iso selects both the most recent
| > standards for C or C++ instead of insisting on different numbers?
|
| Use of such options as -std=whatever and -pedantic is not a magic solution
| for writing portable code, and we should not give the impression that it
| is.
Nobody is saying that writing a program in strict accordance with the
standard automagically gives a portable code. That also doesn't mean
that asking the compiler to be stringent isn't helpful. I think
you're misrepresenting what I'm saying.
What I'm asking is to give an easy-to-write alias to the most recent
standard in effect. I really can understand why that seems so
unreasonable. For regular users, 'gxx -pedantic-errors -ansi' used to
be a good stringent mode for the most recent standard in effect; what
I'm proposing is to replace '-ansi' with something not esoteric which
reflects reality (since gcc -ansi as you say refers to C90).
| ... If someone is using an option to select strict conformance to a
| standard where it conflicts with GNU, this should mean that they are
| writing to the standard. In particular, they have a copy of the standard
| to hand, have read it completely, and have digested and understood its
| technical content.
Sometimes, it serves to get real and recognize that not every GCC
users have a copy of the standard -- most of them usually have reference
books written in familiar language. And I don't think it serves GCC
to require its users to have a copy of the standard.
It also serves to get pragmatic and real to recognize that GCC in its
default mode compiles GNU Whatever language and users sometimes want
to suppress GNU extensions and compile programs in accordance to the
standarrd in effect. Yes, they could use -std=xxxx:yyyy, but then
that starts getting really unnecessarily pedantic and anal.
| ... In this case, use of a particular -std option is a
| precise technical statement to the compiler about their program. The
| standard number appears on every page of C99 apart from the inside back
| cover and the spine.
You seem to think that every programmer who happens to use GCC has a
copy of the standard, or need to have. That is an unreasonable and
unrealistic assumption. And I don't think it serves GCC to require
its users to have a copy of the standard.
[...]
| As for the name: -std exists to provide some regularity to names in this
| area, and another -std name is better than another irregular option -iso
| to add to the existing irregular -ansi, -pedantic and -traditional.
Well, if you feel that '-std' is a better name than '-iso' then that
is OK with me. But, IMNHO there ought be a way to suppress GNU extensions
without requiring esoteric command lines. It is about practicality.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com