bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_PROG_CC_C99 fails when configure with CFLAGS="-Werror -Wall"


From: ChangZhuo Chen
Subject: AC_PROG_CC_C99 fails when configure with CFLAGS="-Werror -Wall"
Date: Mon, 10 Dec 2012 20:25:47 +0800

Hi,

There is a problem in autoconf that cannot use AC_PROG_CC_C99 to detect C99
support when configure with CFLAGS="-Werror -Wall".

For example, if we have the following line in configure.ac
...
AC_PROG_CC
AC_PROG_CC_C99

After autoreconf -i, if we run ./configure CFLAGS="-Werror -Wall", it shows
the following message indicating that C99 features are not supported.
...
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... unsupported
checking for gcc option to enable C99 features... unsupported
checking for gcc option to enable C89 features... none needed


This is because the macro used to detect C99 features will generate the
following compiling warning when CFLAGS is -Wall, and with -Werror, the
autoconf cannot compile the macro.

warning: variable ‘fnumber’ set but not used [-Wunused-but-set-variable]
warning: variable ‘number’ set but not used [-Wunused-but-set-variable]
warning: variable ‘str’ set but not used [-Wunused-but-set-variable]

The GCC version is `gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2'.


The attached patch can fix the problem by using the unused variables, but I
am not sure if that is the correct way to do.

Regards,
ChangZhuo

Attachment: c99.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]