Debian Bug report logs - #754268
commandline-specified CFLAGS override -std= parameter from AC_PROG_CC_C99

version graph

Package: autoconf; Maintainer for autoconf is Alex Myczko <[email protected]>; Source for autoconf is src:autoconf (PTS, buildd, popcon).

Reported by: Wouter Verhelst <[email protected]>

Date: Wed, 9 Jul 2014 10:15:02 UTC

Severity: normal

Found in version autoconf/2.69-7

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Ben Pfaff <[email protected]>:
Bug#754268; Package autoconf. (Wed, 09 Jul 2014 10:15:06 GMT) (full text, mbox, link).


Acknowledgement sent to Wouter Verhelst <[email protected]>:
New Bug report received and forwarded. Copy sent to Ben Pfaff <[email protected]>. (Wed, 09 Jul 2014 10:15:06 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Wouter Verhelst <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: commandline-specified CFLAGS override -std= parameter from AC_PROG_CC_C99
Date: Wed, 09 Jul 2014 09:50:08 +0200
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).

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=nl_BE.UTF-8, LC_CTYPE=nl_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages autoconf depends on:
ii  debianutils  4.4
ii  m4           1.4.17-4
ii  perl         5.18.2-5

Versions of packages autoconf recommends:
ii  automake [automaken]      1:1.14.1-3
ii  automake1.11 [automaken]  1:1.11.6-2

Versions of packages autoconf suggests:
pn  autoconf-archive  <none>
ii  autoconf-doc      2.69-7
ii  gettext           0.18.3.2-3
ii  gnu-standards     2010.03.11-1
ii  libtool           2.4.2-1.7

-- no debconf information



Information forwarded to [email protected], Ben Pfaff <[email protected]>:
Bug#754268; Package autoconf. (Sat, 09 Aug 2014 15:30:18 GMT) (full text, mbox, link).


Acknowledgement sent to Ben Pfaff <[email protected]>:
Extra info received and forwarded to list. Copy sent to Ben Pfaff <[email protected]>. (Sat, 09 Aug 2014 15:30:18 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Ben Pfaff <[email protected]>
To: Wouter Verhelst <[email protected]>, [email protected]
Subject: Re: Bug#754268: commandline-specified CFLAGS override -std= parameter from AC_PROG_CC_C99
Date: Sat, 9 Aug 2014 08:29:51 -0700
[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.



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 12:29:10 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.