lmi
[Top][All Lists]
Advanced

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

Re: [lmi] shadowing warnings


From: Vadim Zeitlin
Subject: Re: [lmi] shadowing warnings
Date: Sun, 5 Jun 2016 19:48:01 +0200

On Sun, 5 Jun 2016 18:06:10 +0200 I wrote:

Me>  And as you were eager to try, I decided to check myself just how
Me> difficult would it be to enable it for lmi code. It turned out that there
Me> were not that many occurrences of the warnings and with the changes at
Me> https://github.com/vadz/lmi/pull/40 I can now build using autotools build
Me> system if I run configure with CPPFLAGS="-isystem ..." and
Me> CXXFLAGS=-Wshadow.

 Sorry, it turned out that while this was sufficient for clang and g++ 6
that I tested, it's not enough by far for gcc 4.9 that we currently use
because it also considers that a local variable can shadow a member
function with the same name and there are tons of occurrences of such
situations in lmi sources (basically, anywhere where an accessor foo() is
used, there is also a parameter called "foo" passed to either a ctor or a
setter).

 It turns out that this was, luckily, just a bug which was fixed in the
later version, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57709, and
after also testing with g++ 5.3, I can also confirm that -Wshadow works
with just the PR 40 with it too, so it's only 4.9 that requires more
changes. IMHO it doesn't make sense to do a lot of these ugly changes just
for 4.9 and, if you're interested in enabling -Wshadow at all, it would be
better to wait until we update to g++5 or 6 and return to this then.

 Please let me know if you disagree, otherwise I'll just keep PR 40 open
but mark it as "postponed".
VZ


reply via email to

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