This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: strict C++ mode
- From: David Fang <fang at csl dot cornell dot edu>
- To: John Love-Jensen <eljay at adobe dot com>
- Cc: MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Thu, 5 Apr 2007 01:19:51 -0400 (EDT)
- Subject: Re: strict C++ mode
> Hi everyone,
>
> Is there a way to get GCC to compile C++ in a "strict C++" mode?
>
> By "strict C++" I mean that when I include <cstdio>, I get symbols that are
> required by ISO 14882, but I don't get symbols that are not specified in ISO
> 14882.
>
> So I'd get:
> std::printf
>
> But I would not get:
> ::printf
Hi Eljay,
There's an open DR 456 about this issue, with some discussion in
PR 6257 (suspended presently).
> And I would not get any #define's that are not required by ISO 14882. (Not
> including header guards that have a double-underscore or start with
> underscore-capital letter.)
In general, when I want tight conformance (personally, always), I pass
"-ansi -pedantic-errors" to the compile flags. You can also fine-tune
with -std=c++{98,03,0x}. May not be bullet-proof, but any issues can
always be filed (and hopefully fixed). :)
Fang
David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
http://www.csl.cornell.edu/~fang/
-- (2400 baud? Netscape 3.0?? lynx??? No problem!)