bug-autoconf
[Top][All Lists]
Advanced

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

AC_C_CONST is sensitive about -W -Wall -Werror CFLAGS.


From: Artur R. Czechowski
Subject: AC_C_CONST is sensitive about -W -Wall -Werror CFLAGS.
Date: Thu, 22 Mar 2012 05:34:41 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hello,
Plase consider simple autoconf.ac script:

AC_INIT([bugreport], [0.1])
AC_C_CONST

After processing it with autoconf there is a differnce between the calls:
./configure
./configure CFLAGS="-W -Wall -Werror"

The first one returns:
checking for an ANSI C-conforming const... yes
but the second one:
checking for an ANSI C-conforming const... no

The reason is: the test program cannot be compiled with -W flags because of
following errors:
conftest.c: In function 'main':
conftest.c:38:10: error: 't' is used uninitialized in this function 
[-Werror=uninitialized]
conftest.c:54:23: error: 'b' may be used uninitialized in this function 
[-Werror=uninitialized]
cc1: all warnings being treated as errors

The full report with logs from both calls is attached.

I'm using Debian GNU/Linux unstable with gcc and autoconf installed
from Debian packages:
ii  autoconf       2.68-1         automatic configure script builder
ii  gcc            4:4.6.2-4      GNU C compiler

Output of both programs with --version option follows.

gcc (Debian 4.6.3-1) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

autoconf (GNU Autoconf) 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>,
<http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Regards
        Artur
-- 
http://www.last.fm/user/arturcz/

Attachment: ac_c_const_bug.tar.bz2
Description: Binary data


reply via email to

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