[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#548708: FTBFS with GCC 4.4: #elif is missing defined()



Package: wv2
Version: 0.4.0.dfsg-1
User: debian-gcc@lists.debian.org
Usertags: ftbfs-gcc-4.4
Tags: patch

This package fails to build with GCC 4.4 which has introduced better
checks in the preprocessor.  Your code does something like:

 #ifdef A
 #elif B
 #endif

but the #elif is wrong: #elif requires a condition whereas you're
trying to test whether B is defined.  You therefore have to use:
 #elif defined(B)

You can reproduce this problem with gcc-4.4/g++-4.4 from unstable.

> Automatic build of wv2_0.4.0.dfsg-1 on em64t by sbuild/amd64 0.53
...
> [ 41%] Building CXX object src/CMakeFiles/wv2.dir/ustring.cpp.o
> cd /build/tbm/wv2-0.4.0.dfsg/obj-x86_64-linux-gnu/src && /usr/bin/c++   -Dwv2_EXPORTS -DHAVE_CONFIG_H -g -O2  -fPIC -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libgsf-1 -I/build/tbm/wv2-0.4.0.dfsg/src -I/build/tbm/wv2-0.4.0.dfsg/obj-x86_64-linux-gnu   -o CMakeFiles/wv2.dir/ustring.cpp.o -c /build/tbm/wv2-0.4.0.dfsg/src/ustring.cpp
> /build/tbm/wv2-0.4.0.dfsg/src/ustring.cpp:81:23: error: #elif with no expression
> /build/tbm/wv2-0.4.0.dfsg/src/ustring.cpp:94:23: error: #elif with no expression
> make[3]: *** [src/CMakeFiles/wv2.dir/ustring.cpp.o] Error 1
> make[3]: Leaving directory `/build/tbm/wv2-0.4.0.dfsg/obj-x86_64-linux-gnu'
> make[2]: *** [src/CMakeFiles/wv2.dir/all] Error 2
> make[2]: Leaving directory `/build/tbm/wv2-0.4.0.dfsg/obj-x86_64-linux-gnu'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/build/tbm/wv2-0.4.0.dfsg/obj-x86_64-linux-gnu'
> dh_auto_build: make returned exit code 2
> make: *** [build] Error 1
> dpkg-buildpackage: error: debian/rules build gave error exit status 2

--- src/ustring.cpp~	2009-09-28 09:27:00.000000000 +0000
+++ src/ustring.cpp	2009-09-28 09:27:59.000000000 +0000
@@ -78,9 +78,9 @@
 {
 #if defined(HAVE_FUNC_ISINF)
   return (isinf(d) == 1);
-#elif HAVE_FUNC_FINITE
+#elif defined(HAVE_FUNC_FINITE)
   return finite(d) == 0 && d == d; // ### can we distinguish between + and - ?
-#elif HAVE_FUNC__FINITE
+#elif defined(HAVE_FUNC__FINITE)
   return _finite(d) == 0 && d == d; // ###
 #else
   return false;
@@ -91,9 +91,9 @@
 {
 #if defined(HAVE_FUNC_ISINF)
   return (isinf(d) == -1);
-#elif HAVE_FUNC_FINITE
+#elif defined(dHAVE_FUNC_FINITE)
   return finite(d) == 0 && d == d; // ###
-#elif HAVE_FUNC__FINITE
+#elif defined(HAVE_FUNC__FINITE)
   return _finite(d) == 0 && d == d; // ###
 #else
   return false;

-- 
Martin Michlmayr
http://www.cyrius.com/



Reply to: