GNOME Bugzilla – Bug 321274
Incorrect log2 definition/detection
Last modified: 2005-11-13 08:18:41 UTC
Version details: 2.6.8 Distribution/Version: OS X 10.4.3 with XCode 2.2 compiler suite A fink user reported the following compiler crash during 'make': gcc -DHAVE_CONFIG_H -I. -I. -I.. -DXTHREADS -D_REENTRANT - DXUSE_MTSAFE_API -DXNO_MTSAFE_UNISTDAPI -DORBIT2=1 -I/sw/include/ glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/pango-1.0 -I/usr/ X11R6/include -I/usr/X11R6/include/freetype2 -I/sw/include/gtk-2.0 -I/ sw/include/atk-1.0 -I/sw/lib/gtk-2.0/include -I/sw/include/libart-2.0 -I/sw/include/libxml2 -I/sw/include -I/sw/include/libgnomecanvas-2.0 - I/sw/include/libgnomeprint-2.2 -I/sw/include/libgnomeprintui-2.2 -I/ sw/include/libglade-2.0 -I/sw/include/orbit-2.0 -I/sw/include/bonobo- activation-2.0 -I/sw/include/gnome-vfs-2.0 -I/sw/include/gnome-vfs- module-2.0 -I/sw/lib/gnome-vfs-2.0/include -I/sw/include/gconf/2 -I/ sw/include/libbonobo-2.0 -I/sw/include/libgnome-2.0 -I/sw/include/ libbonoboui-2.0 -I/sw/include/libgnomeui-2.0 -DGTHUMB_MODULEDIR=\"/sw/ lib/gthumb/modules\" -DGTHUMB_GLADEDIR=\"/sw/share/gthumb/glade\" -no- cpp-precomp -I/sw/include -O3 -funroll-loops -fstrict-aliasing -c print-callbacks.c -fno-common -DPIC -o .libs/print-callbacks.o ... long series of warnings, then: print-callbacks.c: At top level: print-callbacks.c:2020: error: static declaration of 'log2' follows non-static declaration and diagnosed that print-callbacks.c gets the declaration: extern double log2( double ); from <math.h> and noted that since log2 is not a macro, using "#ifndef log2" to protect your local definition of log2 (line 2017) is not working (completely removing that #ifndef ... #endif block allows compiling to complete normally). A better arrangement would be to test for the presence of the log2 function during ./configure and then use the ./configure result when determining whether to declare log2 locally. For example, AC_CHECK_FUNCS(log2) and then #ifndef HAVE_LOG2.
fixed in HEAD and in gthumb-2-6 branch