Re: [eigen] g++ -Wshadow warnings |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] g++ -Wshadow warnings
- From: Jitse Niesen <jitseniesen@xxxxxxxxx>
- Date: Wed, 26 Feb 2014 12:34:15 +0000 (GMT)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1393418066; bh=MO0GX/BSVVjvEuU2OOiXwfLw9HaAzMYHXq2Rq+mmH14=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Date:From:X-X-Sender:To:Subject:In-Reply-To:Message-ID:References:User-Agent:MIME-Version:Content-Type; b=Gr9VokvyWwLpp3lZ4Hzm1b/AH5LQyvRtqjTkxRRb0kKJWGDteRY9bn8d0TWv6FiyyC0FHAVTo5U6YtPdpBDbKhTxbsGR+dydXwh5RuuypDkYywnbJSApS+p8JZO/GQIe7L4gaIxvCmV7F7eLCMJHR9eh6z6ugpduVBQGH5Ehsdc=
On Mon, 24 Feb 2014, Brad Bell wrote:
Does eigen wish to support the -Wshadow flag on the g++ compiler ?
Yes, why not.
With eigen 3.2.0 and g++ 4.8.2 I get:
In member function
void Eigen::internal::variable_if_dynamic<T, -1>::setValue(T)’:
/home/bradbell/prefix/eigen/include/Eigen/src/Core/util/XprHelper.h:65:28:
warning: declaration of ‘value’ shadows a member of 'this' [-Wshadow]
void setValue(T value) { m_value = value; }
In this instance, a variable (function argument) has the same name as a
member function. The risk of confusion seems rather minimal, but it would
be nice not to trigger the warning.
There are quite a number of places in the codebase with this issue, not
only the one above. You're welcome to prepare a patch to fix these.
Alternatively, open a bug at http://eigen.tuxfamily.org/bz/ but in that
case you'll have to wait and see whether it will be followed up.
Jitse