This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/11393] Initializer of static const float class member is not legal in c++98


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11393



------- Additional Comments From jsm28 at cam dot ac dot uk  2003-07-02 23:28 -------
Subject: Re:  Initializer of static const float class member
 is not legal in c++98

On Wed, 2 Jul 2003, rearnsha at arm dot com wrote:

> to get GNU extensions,
> 
> 	-std=c89 
> 
> doesn't give me (at the very least) warnings about GNU extensions.  Why 
> have the option at all?

To accept all code the standard requires us to accept, with the standard
semantics (e.g., enabling trigraphs).

> We should just make the compiler use gnu89 (or gnu99, or whatever) as the 
> default, and have -std=c89 *mean* c89 code not something else.

You mean have the -std options imply -pedantic?  I think that would be
reasonable, to reduce the length of the invocation required for a standard
mode.  (And if we *don't* allow -ansi -no-pedantic to turn the warnings
off again then this would also fix or at least hide a few bugs where
standard code is only accepted with -pedantic.)

> Even more perverse is that 
> 
> 	-std=gnu89 -pedantic
> 
> gives me warnings about ISO-isms.

That is the combination used (implicitly) in GCC bootstrap, with -pedantic
to warn about nonportable usages in GCC but without needing to mess with
feature test macros (which -std=c89 would imply, since it also puts the
headers into standards mode).

The manual explains the concept of "base standard" behind the warnings in
such cases.


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