Boost logo

Boost :

Subject: Re: [boost] [wiki] Warning Guidelines for VC
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2011-01-08 07:32:50


> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
> On Behalf Of Stephan T. Lavavej
> Sent: Friday, January 07, 2011 11:42 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] [wiki] Warning Guidelines for VC
>
> > /Zc:forScope - For loop scoping again
>
> This one's on by default.
>
> > /DNOMINMAX - don't define min/max macros
>
> This affects windows.h, not VC's compiler/libraries, just to be clear.
>
> STL
>
> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
> On Behalf Of Pete Bartlett
> Sent: Friday, January 07, 2011 3:41 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] [wiki] Warning Guidelines for VC
>
> [Snip Discussion on /Za]
>
> Hi Paul,
>
> I've also had problems with /Za that you discuss on the wiki page and at
my
> current shop we don't use it, despite having developers who may compile on
> MSVC only prior to commit. Given we release with GCC too, this means we
want
> to make the compilers as similar as possible.
>
> One way of doing this is to promote certain warnings to errors via compile
flags
> e.g. we currently set
>
> /we4288 - For-loop scoping
> /we4238 - don't take address of temporaries
> /we4239 - don't bind temporaries to non-const references (Stephan's "Evil
> Extension")
> /we4346 - require "typename" where the standard requires it.
> /Zc:forScope - For loop scoping again
> /DNOMINMAX - don't define min/max macros
>
> Perhaps this alternate techinque might be mentioned on that page.

Indeed useful suggestions.

added to version 9 8 Jan 2011

(but I have cautioned that /D nominmax may mask missing brackets, like
(std::numeric_limits<result_type>::max)()

that will be flagged by the inspection program later.

 Better to get it proof against the nasty min/max macros!

Thanks

Paul

---
Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204
pbristow_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk