On 4/4/07, David Fang <fang@xxxxxxxxxxxxxxx> wrote:
> 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 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). :)
Note also that strict standards conformance requires cooperation with the operating system header files. This cooperation may come in the form of additional -D command-line switches. -- Lawrence Crowl