After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 663991 - _XOPEN_SOURCE 500 causes error in Solaris Studio compiler
_XOPEN_SOURCE 500 causes error in Solaris Studio compiler
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.0.x
Other Solaris
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-11-13 22:55 UTC by Raimund Steger
Modified: 2012-05-26 03:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Raimund Steger 2011-11-13 22:55:38 UTC
When compiling gtk+-3.0.12 with Solaris Studio 12.2 on Solaris 10 x86, I get the following error:

  "/usr/include/sys/feature_tests.h", line 332: #error: 
  "Compiler or options invalid for pre-UNIX 03 X/Open applications 
  and pre-2001 POSIX applications"
  cc: acomp failed for gtksearchenginesimple.c

It works after I apply:


--- ./gtk/gtksearchenginesimple.c.orig	Sun Nov 13 20:58:42 2011
+++ ./gtk/gtksearchenginesimple.c	Sun Nov 13 20:58:54 2011
@@ -27,7 +27,7 @@
  * export ftw() and friends only if _XOPEN_SOURCE and _GNU_SOURCE
  * are defined. see bug #444097.
  */
-#define _XOPEN_SOURCE 500
+#define _XOPEN_SOURCE 600
 #define _GNU_SOURCE 
 
 #ifdef HAVE_FTW_H


However, I'm not sure about the implications of making this change on other platforms.

I run the build with -std=c99, which is what the default was.
Comment 1 Fabian Groffen 2012-05-06 14:36:53 UTC
Not limited to Solaris Studio compiler, also with gcc the same happpens.  C99 implies at minimum _XOPEN_SOURCE=600.