From: Paul Eggert Date: Tue, 28 Dec 2010 07:31:43 +0000 (-0800) Subject: autoconf: Use -D_STDC_C99=, not -xc99=all, with Solaris cc X-Git-Tag: v2.68b~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18779ad8f941738075be2c70d6c16acd932fd73b;p=thirdparty%2Fautoconf.git autoconf: Use -D_STDC_C99=, not -xc99=all, with Solaris cc * lib/autoconf/c.m4 (_AC_PROG_CC_C99): Use -D_STDC_C99= rather than -xc99=all to convince Solaris Studio cc to compile c99 programs. --- diff --git a/ChangeLog b/ChangeLog index c1ec95d8..8c9b89fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-12-27 Paul Eggert + + autoconf: Use -D_STDC_C99=, not -xc99=all, with Solaris cc + * lib/autoconf/c.m4 (_AC_PROG_CC_C99): Use -D_STDC_C99= rather than + -xc99=all to convince Solaris Studio cc to compile c99 programs. + 2010-11-26 Paul Eggert autotest: fix file descriptor leak diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index a873ccd2..5479056e 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -1340,11 +1340,20 @@ dnl AIX -qlanglvl=extc99 (unused restrictive mode: -qlanglvl=stdc99) dnl HP cc -AC99 dnl Intel ICC -std=c99, -c99 (deprecated) dnl IRIX -c99 -dnl Solaris -xc99=all (Forte Developer 7 C mishandles -xc99 on Solaris 9, -dnl as it incorrectly assumes C99 semantics for library functions) +dnl Solaris -D_STDC_C99= +dnl cc's -xc99 option uses linker magic to define the external +dnl symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99 +dnl behavior for C library functions. This is not wanted here, +dnl because it means that a single module compiled with -xc99 +dnl alters C runtime behavior for the entire program, not for +dnl just the module. Instead, define the (private) symbol +dnl _STDC_C99, which suppresses a bogus failure in . +dnl The resulting compiler passes the test case here, and that's +dnl good enough. For more, please see the thread starting at: +dnl http://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html dnl Tru64 -c99 dnl with extended modes being tried first. -[[-std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99]], [$1], [$2])[]dnl +[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99]], [$1], [$2])[]dnl ])# _AC_PROG_CC_C99