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: -std's (was Re: v3 link failures analyzed)


On 11 Jan 2001, Gabriel Dos Reis wrote:

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

It might have been better for GCC to have been designed with such a mode
(-std=isowhatever -pedantic) as the default, but that's not the design we
have now.

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

But, as documented, these options only suppress extensions in conflict
with the standard, and give diagnostics required by the standard.  The
idealised user I was describing will understand this; the non-ideal user,
without the concept of "constraint violation", may well get confused.

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

If the standards bodies would learn something about selling their
standards as ordinary books through ordinary bookshops at ordinary prices,
then I might hope for most users indeed to have a copy of the standard.
As is, whatever other books they use presumably describe the language as
according to a particular version of the standard.

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

I'm not saying that such an option should not be provided - but that it
would get misused for warm feelings about portability as much as it would
get properly used as a shortcut by users who know what standard version it
refers to with their compiler and are familiar with its limitations.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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