[eigen] Fix for invalid integer constant |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Fix for invalid integer constant
- From: Keir Mierle <mierle@xxxxxxxxx>
- Date: Thu, 5 Jan 2012 23:23:03 -0800
- Cc: Sameer Agarwal <sameeragarwal@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=XGSeNgEhgCvDduUxA3VIEBCqOQShTQblJcWKFM4XVXM=; b=wYq/Bmd15nnD/JZo/w7rc6i7im1tEHSVpTZuiYaODX9RpgSdA7DRN1ieIuov9EAIuk VFa5q7dbP9/IwZRBIwSXbVqPmPbw3hFV6H2r47i1Zq/4QWyO65JlrbPe7eRtkcgadeCh J6S5cZFb2Lcod8DRH0wv8B60Zmh2/DHouXWWw=
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
# HG changeset patch
# User Keir Mierle <mierle@xxxxxxxxx>
# Date 1325834109 28800
# Branch 3.0
# Node ID 9f1e5198da7fa08f82e297949d85b24760571f64
# Parent 7a3491a304e43c4a271d2b7d7d36e89930061dcf
Fix out-of-range int constant in 4x4 inverse.
diff -r 7a3491a304e4 -r 9f1e5198da7f Eigen/src/LU/arch/Inverse_SSE.h
--- a/Eigen/src/LU/arch/Inverse_SSE.h Fri Dec 23 22:39:32 2011 +0100
+++ b/Eigen/src/LU/arch/Inverse_SSE.h Thu Jan 05 23:15:09 2012 -0800
@@ -55,7 +55,7 @@
static void run(const MatrixType& matrix, ResultType& result)
{
- EIGEN_ALIGN16 const int _Sign_PNNP[4] = { 0x00000000, 0x80000000, 0x80000000, 0x00000000 };
+ EIGEN_ALIGN16 const unsigned int _Sign_PNNP[4] = { 0x00000000, 0x80000000, 0x80000000, 0x00000000 };
// Load the full matrix into registers
__m128 _L1 = matrix.template packet<MatrixAlignment>( 0);