[Debian-med-packaging] Bug#701888: Bug#701888: insighttoolkit4: FTBFS on powerpcspe with "error: #if with no expression"

Roland Stigge stigge at antcom.de
Thu Feb 28 16:05:12 UTC 2013


On 02/28/2013 04:02 PM, Steve M. Robbins wrote:
>> [...] [ 44%] Building C object
>> Modules/ThirdParty/TIFF/src/itktiff/CMakeFiles/itktiff.dir/tif_predict.c.o
>>
>> 
cd /«PKGBUILDDIR»/BUILD/Modules/ThirdParty/TIFF/src/itktiff &&
/usr/bin/gcc  -Ditktiff_EXPORTS -DJPEG_SUPPORT -DZIP_SUPPORT
-D_HPUX_SOURCE -g -O2 -fstack-protector --param=ssp-buffer-size=4
-Wformat -Werror=format-security -D_FORTIFY_SOURCE=2
-Wno-uninitialized -Wno-unused-parameter -Wall -Wcast-align
-Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch
-Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings
-funit-at-a-time -Wno-strict-overflow  -w -fno-strict-aliasing -O3
-DNDEBUG -fPIC
-I/«PKGBUILDDIR»/BUILD/Modules/ThirdParty/TIFF/src/itktiff
-I/«PKGBUILDDIR»/Modules/ThirdParty/TIFF/src/itktiff
-I/«PKGBUILDDIR»/BUILD/Modules/ThirdParty/JPEG/src
-I/«PKGBUILDDIR»/BUILD/Modules/ThirdParty/KWSys/src
-I/«PKGBUILDDIR»/BUILD/Modules/ThirdParty/ZLIB/src
-I/«PKGBUILDDIR»/BUILD/Modules/ThirdParty/TIFF/src
-I/«PKGBUILDDIR»/Modules/ThirdParty/TIFF/src    -o
CMakeFiles/itktiff.dir/tif_predict.c.o   -c /«PKGBUILDDIR»/
>> Modules/ThirdParty/TIFF/src/itktiff/tif_predict.c 
>> /«PKGBUILDDIR»/Modules/ThirdParty/TIFF/src/itktiff/tif_predict.c:
>> In function 'fpAcc': 
>> /«PKGBUILDDIR»/Modules/ThirdParty/TIFF/src/itktiff/tif_predict.c:394:26:
>> error: #if with no expression 
>> /«PKGBUILDDIR»/Modules/ThirdParty/TIFF/src/itktiff/tif_predict.c:
>> In function 'fpDiff': 
>> /«PKGBUILDDIR»/Modules/ThirdParty/TIFF/src/itktiff/tif_predict.c:563:26:
>> error: #if with no expression make[3]: ***
>> [Modules/ThirdParty/TIFF/src/itktiff/CMakeFiles/itktiff.dir/tif_predict.c.o]
>> Error 1 make[3]: Leaving directory `/«PKGBUILDDIR»/BUILD' 
>> make[2]: ***
>> [Modules/ThirdParty/TIFF/src/itktiff/CMakeFiles/itktiff.dir/all]
>> Error 2 make[2]: Leaving directory `/«PKGBUILDDIR»/BUILD' 
>> make[1]: *** [all] Error 2 make[1]: Leaving directory
>> `/«PKGBUILDDIR»/BUILD' dh_auto_build: make -j1 returned exit
>> code 2 make: *** [build-arch] Error 2 dpkg-buildpackage: error:
>> debian/rules build-arch gave error exit status 2 [...]
>> 
>> This is because of WORDS_BIGENDIAN (which is either defined or
>> not) used as "#if WORDS_BIGENDIAN".
> 
> That is has always been legal C preprocessor syntax (an undefined
> macro is "false") [1] so what has changed?
> 
> [1] http://gcc.gnu.org/onlinedocs/cpp/If.html

In case of undefined WORDS_BIGENDIAN, it actually works. :-) But in
case of "#define WORDS_BIGENDIAN" (as on powerpc*), the problem
occurs. Easily reproducible:

$ cat | gcc -E -Wall -
#define WORDS_BIGENDIAN
#if WORDS_BIGENDIAN
#endif
main(){}
# 1 "<stdin>"
# 1 "<command-line>"
# 1 "<stdin>"
<stdin>:2:20: error: #if with no expression

Tested with gcc 4.6 and 4.7.

It is consistent with the phrase you are probably referring to in the
link you posted:

"Identifiers that are not macros, which are all considered to be the
number zero. This allows you to write #if MACRO instead of #ifdef
MACRO, if you know that MACRO, when defined, will always have a
nonzero value."

Plain "#define WORDS_BIGENDIAN" doesn't seem to provide the latter...

Roland



More information about the Debian-med-packaging mailing list