[resending due to wrong @bugs address in last copy, sorry]

On Wed, Jul 09, 2014 at 09:50:08AM +0200, Wouter Verhelst wrote:
> Package: autoconf
> Version: 2.69-7
> Severity: normal
> 
> Hi,
> 
> The nbd configure.ac contains:
> 
> AC_PROG_CC_C99
> 
> because I use a number of C99 constructs in the code. When, however, I
> run configure like so:
> 
> ./configure CFLAGS='-g -O0 -Wall -Werror'
> 
> because I want to clean up the code a bit, I get an error message at
> compile time:
> 
> nbdsrv.c: In function 'getmaskbyte':
> nbdsrv.c:116:2: error: 'for' loop initial declarations are only allowed in 
> C99 or C11 mode
>   for(int i = 7; i + masklen > 7; i--) {
>   ^
> 
> which is surprising, since I asked for C99 mode. If I specify CFLAGS so
> it also contains '-std=gnu99', then everything compiles cleanly (apart
> from the bits that are caused by the -Wall -Werror, that is).

Specifying -Werror in CFLAGS to configure is almost always a mistake.
It screws up Autoconf tests, because some Autoconf tests unavoidably
provoke warnings.  Remove -Werror and you'll get better results.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to