[eigen] Fix for broken asserts revealed by Clang

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


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;
   }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/