When compiling a translation unit that includes Eigen/Core using GCC 4.4.3 (in this case the standard compiler in the Android NDK toolchain, r8), the following compile error occurs: In file included from ../Eigen/Core:267, from .......: ../Eigen/src/Core/MathFunctions.h:848: error: expected unqualified-id before 'sizeof' ../Eigen/src/Core/MathFunctions.h:848: error: expected ')' before 'sizeof' ../Eigen/src/Core/MathFunctions.h:848: error: expected ')' before 'sizeof' Line 848 is the definition of template<typename T> bool isfinite(const T& x). This fails to compile since isfinite() is defined as a macro in the toolchain's math.h as follows: #define isfinite(x) \ ((sizeof (x) == sizeof (float)) ? __isfinitef(x) \ : (sizeof (x) == sizeof (double)) ? __isfinite(x) \ : __isfinitel(x)) Two possible solutions could be to either #undef isfinite just before the function template definition or, preferably, to choose another name for the function template (e.g. is_finite).
See this thread in the forum: http://forum.kde.org/viewtopic.php?f=74&t=102930&p=225608&hilit=isfinite#p225608 What we can do is to protect isfinite with parenthesis.
Fixed: https://bitbucket.org/eigen/eigen/changeset/1fc8deb4fedb/ changeset: 1fc8deb4fedb user: ggael date: 2012-07-05 17:22:25 summary: Fix bug 480: workaround the Android NDK defining isfinite as a macro https://bitbucket.org/eigen/eigen/changeset/c8e060b47beb/ changeset: c8e060b47beb branch: 3.1 user: ggael date: 2012-07-05 17:22:25 summary: Fix bug 480: workaround the Android NDK defining isfinite as a macro (transplanted from 1fc8deb4fedba96f7e5a470edc314985cac4c7d3)
*** Bug 484 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/480.