ISO standards macro are rejected by g++

Gabriel Dos Reis gdr@codesourcery.com
Tue Apr 25 12:54:00 GMT 2000


Zack Weinberg <zack@wolery.cumb.org> writes:

| On Tue, Apr 25, 2000 at 09:55:26PM +0200, Thierry Vignaud wrote:
| > g++ (both 2.95.x and egcs snapshots) rejects __file__ __FUNCTION__ and
| > __PRETTY_FUNCTION__ whithout -fpermissive, which don't comply to the
| > standard.
| 
| In my tests, g++ (either 2.95 or snapshot) does not reject
| __FUNCTION__ even with an explicit -pedantic.  This is wrong.
| __FUNCTION__ and __PRETTY_FUNCTION__ are GNU extensions, and as such
| g++ should reject them in pedantic mode.

More generally, g++ does not (currently) reject some of GNU extenion
identifiers beginning with __.  I'm not sure what should be the right 
approach. For example I don't want g++ to complain about __complex__
in the standard header <complex>.  I guess one could complain
conditionally according to some flags  (for example testing 
in_system_header_p). 

-- Gaby


More information about the Gcc-bugs mailing list