Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost 1.54.0 Header Warnings: Shadowed Variables
From: Eric Prud'hommeaux (eric_at_[hidden])
Date: 2013-11-13 15:30:54


On Nov 13, 2013 8:40 PM, "Chris Glover" <c.d.glover_at_[hidden]> wrote:
>>
>> Remember, the intent of the warning is to warn the programmer about
>> possible misuse of one versus the other, so clearly renaming one is a
>> good practice for code for public use.
>
>
> In my opinion this is an over-simplification. Many warnings raise false
alarms in perfectly legitimate code and in my professional experience,
jumping through the 'warning free' hoops to clean that up leads to
obfuscated code as you make things more complicated just to silence
warnings.
>
> This is not a good thing.
>
> So, though I don't think the code should be changed to fix this, it could
be argued that the warning should be silenced in the header so as to not
pollute your warning stream.

That would meet the use case of the programmer writing portable code and
counting on -Wshadow. While he/she could put in a zillion pragmas around
the includes, maintaining those pragmas makes using the library less
attractive. I quit using a library for exactly this reason.

> -- chris
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net