Subject: Re: [boost] [Wiki] Changes in information about gcc warnings.
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-01-19 10:18:06
Patrick Horgan wrote:
> I just added this to the wiki for pedantic:
> This instructs GCC to consider the release version of C or
> C++ and to first issue all warnings required by that
> version of the standard, and second warn about the use of
> gcc extenstions to the language. This would, for instance
> warn about the use of /#ident/ since it is a gcc extension
> and is not in any of the standards. Using -pedantic makes
> it easier to write portable code, or at least to know when
> it is not. Best used with the /-std=xxxxx/ argument to the
> compiler, so that you know what version of the standard
> you're being compared to. Currently if /-std=xxxxx/ is not
> specified, it's as if you'd written /-std=gnu++98/. Much
> of boost uses facilities from more recent versions of the
> standard, so it might make more sense to explicitly
> specify /-std=c++0x/ or /-std=gnu++0x/. /-std=c++0x/ is
> most portable. See the page
> http://gcc.gnu.org/onlinedocs/gcc/Standards.html for more
There's good information there, but it's a bit verbose and could include the limited ability to suppress some warnings. Perhaps this would work better?
"This causes GCC to issue all required diagnostics of the language standard given by the -std=xxxx option (the default is -std=gnu++98) and to warn about the use of GCC extensions. (This would, for instance, warn about the use of #ident, which is a non-standard, GCC extension.) Some of the warnings this option will trigger can be suppressed, such as the use of long long in C++98 code with -Wno-long-long, but most cannot.
"Using this option helps to write portable code for a given language standard. Boost increasingly uses C++0x features, so -std=c++0x increasingly is a necessary alternative to the default.
"Refer to http://gcc.gnu.org/onlinedocs/gcc/Standards.html for more
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk