[eigen] Fix for broken asserts revealed by Clang |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] Fix for broken asserts revealed by Clang
- From: Keir Mierle <mierle@xxxxxxxxx>
- Date: Wed, 18 Jan 2012 15:09:45 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=72vWONoRb6uRTes/apFixQWTDs9f3FJc8UL+hFZt2NU=; b=yDWjMCZptKIF7dqEn7gNaeiE7JlF1GXEVN4bYOjuBGRCWXHErbCyEStCOAAEpTwYrd 5wxlQrZjc9NG4SQ02bNMeSkioBODWH5ZYkeW+67cAG0NcNeeEwS1ZYJdSmoBhx54iLSe pxt7lsILe18/0Hj+z2z1RLXHEBmI/mdlFDSBI=
The attached mercurial export fixes some broken asserts. It's surprising that these ever worked as expected, since the asserts always evaluated to true before. Clang forbids converting char pointers to bool, which is what triggered this.
Keir
# HG changeset patch
# User Keir Mierle <mierle@xxxxxxxxx>
# Date 1326927807 28800
# Node ID 80fd9c3c0975aa9afd7b3e292404473550ed330c
# Parent 06accfd6ab985a7603c1c5275aafadc2648608d3
Fix broken asserts releaved by Clang.
diff -r 06accfd6ab98 -r 80fd9c3c0975 Eigen/src/Eigenvalues/EigenSolver.h
--- a/Eigen/src/Eigenvalues/EigenSolver.h Wed Jan 18 17:45:22 2012 +0100
+++ b/Eigen/src/Eigenvalues/EigenSolver.h Wed Jan 18 15:03:27 2012 -0800
@@ -573,7 +573,7 @@
}
else
{
- eigen_assert("Internal bug in EigenSolver"); // this should not happen
+ eigen_assert(0 && "Internal bug in EigenSolver"); // this should not happen
}
}
diff -r 06accfd6ab98 -r 80fd9c3c0975 Eigen/src/Geometry/Hyperplane.h
--- a/Eigen/src/Geometry/Hyperplane.h Wed Jan 18 17:45:22 2012 +0100
+++ b/Eigen/src/Geometry/Hyperplane.h Wed Jan 18 15:03:27 2012 -0800
@@ -225,7 +225,7 @@
normal() = mat * normal();
else
{
- eigen_assert("invalid traits value in Hyperplane::transform()");
+ eigen_assert(0 && "invalid traits value in Hyperplane::transform()");
}
return *this;
}