[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [PATCH] Avoid harmless but annoying arg[cv] shadowing warnings

From: Greg Chicares
Subject: Re: [lmi] [PATCH] Avoid harmless but annoying arg[cv] shadowing warnings
Date: Sat, 4 Jun 2016 23:44:35 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0

On 2016-06-04 17:31, Vadim Zeitlin wrote:
> On Sat, 4 Jun 2016 17:19:42 +0000 Greg Chicares <address@hidden> wrote:
> GC> On 2016-06-04 14:30, Vadim Zeitlin wrote:
> GC> > It could also allow us to enable -Wshadow (currently
> GC> > commented out in workhorse.make) in the future for the gcc builds.
> GC> 
> GC> Last sentence--not quite, e.g.:
> GC> 
> GC> /opt/lmi/third_party/include/xmlwrapp/node.h: In constructor 
> 'xml::node::text::text(const char*)':
> GC> /opt/lmi/third_party/include/xmlwrapp/node.h:163:42: error: declaration 
> of 'text' shadows a member of 'this' [-Werror=shadow]
> GC>          explicit text (const char *text) : t(text) {}
> GC>                                           ^
> GC> And a zillion boost errors, and more.
>  Yes, this is why I wrote "in the future"...

I was eager to try.

> I didn't look at this in
> details, but the simplest solution would be to ignore the warnings in these
> headers using either -isystem gcc option (probably preferable) or #pragmas
> disabling/reenabling warnings before/after including third party headers.
> Unlike the other recently discussed warnings, I think it would be worth
> enabling this one because -Wshadow does find real problems relatively often
> in average C++ code. lmi quality is higher than that, of course, but I
> still think it could be useful even for it.

But...if it often finds real problems in application code, then isn't it
also likely to find real problems in system code (which '-isystem' would
only mask)?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]