URL: <https://savannah.gnu.org/support/?110451>
Summary: autoconf 2.71 generated configure file does not enable C compiler flag for C99 on Solaris 10 Project: Autoconf Submitted by: haible Submitted on: Sat 27 Feb 2021 09:05:03 PM CET Category: None Priority: 5 - Normal Severity: 3 - Normal Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Operating System: Solaris _______________________________________________________ Details: This is a regression in autoconf 2.71, compared to autoconf 2.69. Find attached two tarballs, hello-c-2.69.tar.gz (generated with autoconf 2.69) and hello-c-2.71.tar.gz (generated with autoconf 2.71). They contain the same source code, except for the version number in configure.ac. In particular, they contain - in configure.ac, an AC_PROG_CC_C99 invocation, - in hello.c: code that requires C99. The commands to regenerate everything in these tarballs is: aclocal -I m4 autoconf autoheader automake -a -c rm -rf autom4te.cache On Solaris 10, I'm using CC="cc -O". This compiler is not C99 compliant, but it accepts the option '-xc99' which makes it C99 compliant. Both packages ought to exhibit the same behaviour, but they don't: * The hello-c-2.69 package compiles fine. ./configure prints: checking whether we are using the GNU C compiler... no checking whether cc -O accepts -g... yes checking for cc -O option to accept ISO C89... none needed checking whether cc -O understands -c and -o together... yes checking whether make supports the include directive... yes (GNU style) checking dependency style of cc -O... none checking for cc -O option to accept ISO C99... -D_STDC_C99= The option '-D_STDC_C99=' is probably not entirely equivalent to '-xc99', but it is good enough: The compilation command cc -O -D_STDC_C99= -DHAVE_CONFIG_H -I. -I.. -g -c -o hello.o ../hello.c succeeds. * The hello-c-2.71 package does not build. ./configure prints: checking whether the compiler supports GNU C... no checking whether cc -O accepts -g... yes checking for cc -O option to enable C11 features... unsupported checking for cc -O option to enable C99 features... unsupported checking for cc -O option to enable C89 features... none needed Then the compilation command fails: cc -O -DHAVE_CONFIG_H -I. -I.. -g -c -o hello.o ../hello.c "/usr/include/sys/feature_tests.h", line 341: #error: "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications require the use of c99" cc: acomp failed for ../hello.c *** Error code 2 When I set CC="cc -O -xc99", then ./configure prints checking whether the compiler supports GNU C... no checking whether cc -O -xc99 accepts -g... yes checking for cc -O -xc99 option to enable C11 features... unsupported checking for cc -O -xc99 option to enable C99 features... none needed and the compilation command succeeds: cc -O -xc99 -DHAVE_CONFIG_H -I. -I.. -g -c -o hello.o ../hello.c So, that is a workaround. But the point of the AC_PROG_CC_C99 macro is that the autoconfiguration finds out about the '-xc99' by itself, isn't it? _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Sat 27 Feb 2021 09:05:03 PM CET Name: hello-c-2.69.tar.gz Size: 75KiB By: haible <http://savannah.gnu.org/support/download.php?file_id=50939> ------------------------------------------------------- Date: Sat 27 Feb 2021 09:05:03 PM CET Name: hello-c-2.71.tar.gz Size: 75KiB By: haible <http://savannah.gnu.org/support/download.php?file_id=50940> _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/support/?110451> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/