Keir Mierle | 6 Jan 08:23 2012
Picon

Fix for invalid integer constant

The attached patch fixes the following compile error, which happens when compiling Eigen with some C++11 warnings turned on in Clang.

./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:60: error: constant expression evaluates to 2147483648 which cannot be narrowed to type 'int' in C++11 [-Werror,-Wc++11-narrowing]
    EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000, 0x80000000, 0x00000000 };
                                                           ^~~~~~~~~~
./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:60: note: override this message by inserting an explicit cast
    EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000, 0x80000000, 0x00000000 };
                                                           ^~~~~~~~~~
                                                           static_cas)<int>(
./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:72: error: constant expression evaluates to 2147483648 which cannot be narrowed to type 'int' in C++11 [-Werror,-Wc++11-narrowing]
    EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000, 0x80000000, 0x00000000 };
                                                                       ^~~~~~~~~~
./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:72: note: override this message by inserting an explicit cast
    EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000, 0x80000000, 0x00000000 };
                                                                       ^~~~~~~~~~
                                                                       static_cas)<int>(
./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:60: error: constant expression evaluates to 2147483648 which cannot be narrowed to type 'int' in C++11 [-Werror,-Wc++11-narrowing]
    EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000, 0x80000000, 0x00000000 };
                                                           ^~~~~~~~~~
./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:60: note: override this message by inserting an explicit cast
    EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000, 0x80000000, 0x00000000 };
                                                           ^~~~~~~~~~
                                                           static_cas)<int>(
./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:72: error: constant expression evaluates to 2147483648 which cannot be narrowed to type 'int' in C++11 [-Werror,-Wc++11-narrowing]
    EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000, 0x80000000, 0x00000000 };
                                                                       ^~~~~~~~~~
./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:72: note: override this message by inserting an explicit cast
    EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000, 0x80000000, 0x00000000 };
                                                                       ^~~~~~~~~~
                                                                       static_cas)<int>(

Let me know if more details are needed.

Keir
Gael Guennebaud | 6 Jan 09:33 2012
Picon

Re: Fix for invalid integer constant

sounds good to me, patch applied. thanks.

gael

On Fri, Jan 6, 2012 at 8:23 AM, Keir Mierle <mierle@...> wrote:
> The attached patch fixes the following compile error, which happens when
> compiling Eigen with some C++11 warnings turned on in Clang.
>
> ./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:60: error: constant
> expression evaluates to 2147483648 which cannot be narrowed to type 'int' in
> C++11 [-Werror,-Wc++11-narrowing]
>     EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000,
> 0x80000000, 0x00000000 };
>                                                            ^~~~~~~~~~
> ./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:60: note: override
> this message by inserting an explicit cast
>     EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000,
> 0x80000000, 0x00000000 };
>                                                            ^~~~~~~~~~
>                                                            static_cas)<int>(
> ./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:72: error: constant
> expression evaluates to 2147483648 which cannot be narrowed to type 'int' in
> C++11 [-Werror,-Wc++11-narrowing]
>     EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000,
> 0x80000000, 0x00000000 };
>
>  ^~~~~~~~~~
> ./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:72: note: override
> this message by inserting an explicit cast
>     EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000,
> 0x80000000, 0x00000000 };
>
>  ^~~~~~~~~~
>
>  static_cas)<int>(
> ./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:60: error: constant
> expression evaluates to 2147483648 which cannot be narrowed to type 'int' in
> C++11 [-Werror,-Wc++11-narrowing]
>     EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000,
> 0x80000000, 0x00000000 };
>                                                            ^~~~~~~~~~
> ./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:60: note: override
> this message by inserting an explicit cast
>     EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000,
> 0x80000000, 0x00000000 };
>                                                            ^~~~~~~~~~
>                                                            static_cas)<int>(
> ./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:72: error: constant
> expression evaluates to 2147483648 which cannot be narrowed to type 'int' in
> C++11 [-Werror,-Wc++11-narrowing]
>     EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000,
> 0x80000000, 0x00000000 };
>
>  ^~~~~~~~~~
> ./third_party/eigen3/Eigen/src/LU/arch/Inverse_SSE.h:58:72: note: override
> this message by inserting an explicit cast
>     EIGEN_ALIGN16 const  int _Sign_PNNP[4] = { 0x00000000, 0x80000000,
> 0x80000000, 0x00000000 };
>
>  ^~~~~~~~~~
>
>  static_cas)<int>(
>
> Let me know if more details are needed.
>
> Keir


Gmane