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: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 18 Jun 2012 19:51:50 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=BCdVspXsCtgW8YpOkd8C1Hwog6F1w8/zkjTtfd3UbuY=; b=IzZ3Kc5QnGkWjxUAlFGAatA4TPxruH9Vgp5atiNaidsJBE/Y0on/ctPGchBbapwZ0+ aSYky0OcYANHPlCLCwvMwRNr0D0HcHbcK2d3WXwgoPJVV3p4zZUurEOyeVeWeVmfx8Ar DV6/WC7T+gakv9AkzQsYwjGCgVaQDfcv9j8yOG3ANTsn98Cwu/pSV1yCZJuulStOsNw6 EBdVQ6taK46ays1ByLPAcjFqXqLSyq8Ul0COjmcwpy3yCioj1PUCMxXWPdigINK8RyHZ 0M10x48C4Ed8L+UkOKMmGot8T0UbibyBqIhVepyCLQ9/0TO3ws7kaQNYeCUD4jTA+O6b DycA==
There are too many instances for a quick fix. In the meantime, you can
disable this warning for eigen:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#include <Eigen/Eigen>
#pragma GCC diagnostic pop
gael.
On Mon, Jun 18, 2012 at 2:51 AM, Brad Bell <bradbell@xxxxxxxxxx> wrote:
> I find the g++ -Wshadow warnings very useful. Unfortunately, one can not use
> them with Eigen programs. For example, comping the simple first program on
> http://eigen.tuxfamily.org/dox/GettingStarted.html
> with g++ -Wshadow I get:
>
> In file included from /home/bradbell/eigen/Eigen/Core:261:0,
> from /home/bradbell/eigen/Eigen/Dense:1,
> from eigen_shadow.cpp:2:
> /home/bradbell/eigen/Eigen/src/Core/util/XprHelper.h: In constructor
> ‘Eigen::internal::variable_if_dynamic<T,
> -0x000000001>::variable_if_dynamic(T)’:
> /home/bradbell/eigen/Eigen/src/Core/util/XprHelper.h:78:43: warning:
> declaration of ‘value’ shadows a member of 'this' [-Wshadow]
> /home/bradbell/eigen/Eigen/src/Core/util/XprHelper.h: In member function
> ‘void Eigen::internal::variable_if_dynamic<T, -0x000000001>::setValue(T)’:
> /home/bradbell/eigen/Eigen/src/Core/util/XprHelper.h:80:28: warning:
> declaration of ‘value’ shadows a member of 'this' [-Wshadow]
> In file included from /home/bradbell/eigen/Eigen/Core:284:0,
> from /home/bradbell/eigen/Eigen/Dense:1,
> from eigen_shadow.cpp:2:
> /home/bradbell/eigen/Eigen/src/Core/DenseCoeffsBase.h: In member function
> ‘void Eigen::DenseCoeffsBase<Derived,
> 1>::writePacket(Eigen::DenseCoeffsBase<Derived, 1>::Index,
> Eigen::DenseCoeffsBase<Derived, 1>::Index, const typename
> Eigen::internal::packet_traits<typename
> Eigen::internal::traits<T>::Scalar>::type&)’:
> /home/bradbell/eigen/Eigen/src/Core/DenseCoeffsBase.h:446:5: warning:
> declaration of ‘x’ shadows a member of 'this' [-Wshadow]
>
> ... snip ...
>
>