Boost logo

Boost :

Subject: Re: [boost] Warning policy? local variable hides (i.e. shadows) global variable
From: Olaf van der Spek (ml_at_[hidden])
Date: 2015-01-15 13:01:33


On Thu, Jan 15, 2015 at 6:58 PM, Beman Dawes <bdawes_at_[hidden]> wrote:
> On Thu, Jan 15, 2015 at 9:25 AM, Niall Douglas
> <s_sourceforge_at_[hidden]> wrote:
>> On 15 Jan 2015 at 8:11, Beman Dawes wrote:
>>
>>> Should Boost have policy to clear these warnings?
>>>
>>> Thoughts?
>>
>> Personally I'd be opposed to setting such a policy for all libraries.
>
> The question needs to be reformulated. We already have a policy to
> clear warnings in the builds of compiled libraries, and had a sprint a
> few years ago that eliminated most or maybe even all of those
> warnings.
>
> Where I'm having a problem is headers like lexical_cast.hpp (and its
> implementation headers) that shadow "n", "str", and "ch". What do we
> tell users who don't want to turn the warnings off?

Don't use global variables (with such generic names).

-- 
Olaf

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