GNOME Bugzilla – Bug 561962
Build failure in core/util.c due to _POSIX_C_SOURCE
Last modified: 2008-11-23 21:53:53 UTC
Please describe the problem: In metacity-2.24.0/src/core/util.c, line 26: > #define _POSIX_C_SOURCE /* for fdopen() */ breaks building on OS X 10.4. Steps to reproduce: 1. ./configure 2. make Actual results: gcc -DHAVE_CONFIG_H -I. -I.. -I/sw/lib/fontconfig2/include -I/sw/include/startup-notification-1.0 -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/dbus-1.0 -I/sw/lib/dbus-1.0/include -I/sw/include/orbit-2.0 -I/sw/include/gconf/2 -I/sw/lib/pango-ft219/include/pango-1.0 -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include -I/sw/include/libpng12 -I/sw/include -I/sw/include/pixman-1 -I/sw/include/cairo -I/sw/include/gtk-2.0 -I/sw/include/atk-1.0 -I/sw/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/X11/include -DORBIT2=1 -I ./include -DMETACITY_LIBEXECDIR=\"/sw/lib/metacity\" -DHOST_ALIAS=\"\" -DMETACITY_LOCALEDIR=\"/sw/share/locale\" -DMETACITY_PKGDATADIR=\"/sw/share/metacity\" -DMETACITY_DATADIR=\"/sw/share\" -DG_LOG_DOMAIN=\"metacity\" -DSN_API_NOT_YET_FROZEN=1 -I/sw/lib/fontconfig2/include -I/sw/include -I/usr/X11R6/include -Os -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -c core/util.c -fno-common -DPIC -o .libs/libmetacity_private_la-util.o In file included from /usr/include/sys/_types.h:26, from /usr/include/_types.h:27, from /usr/include/signal.h:61, from /sw/include/glib-2.0/glib/gbacktrace.h:35, from /sw/include/glib-2.0/glib.h:36, from ./include/util.h:28, from core/util.c:29: /usr/include/sys/cdefs.h:270:49: error: operator '&&' has no right operand /usr/include/sys/cdefs.h:276:49: error: operator '&&' has no right operand make[2]: *** [libmetacity_private_la-util.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 m Expected results: Should compile successfully. Does this happen every time? Other information: Removing that #define solves the build problem and doesn't lead to any problems to indicate fdopen() is not declared. According to the darwin manpage for fdopen, it's in stdio.h and doesn't require and special #define tricks. Manpage on my redhat box is similar. I was also able to remove the preceeding #define _GNU_SOURCE; are those flags still needed somewhere/anywhere? At minimum "if fdopen needs _P_C_S" seems like it would be a simple ./configure test that would improve cross-platform portability.
yes, fixed by revision 4026