Build failure with autotools and gcc 4.8 since version 1.4.60
We have the following build failure on buildroot with autotools and gcc 4.8 since version 1.4.60:
array.c: In function 'array_free_data': array.c:138:2: warning: ISO C90 forbids mixed declarations and code [-Wpedantic] data_unset ** const data = a->data; ^
This build failure can be fixed by running autoreconf so I assume that the configure provided in the official tarball has not been rebuilt after
Can you confirm this issue and fix it for version 1.4.62?
- Status changed from New to Invalid
- Target version deleted (
Note: The C99 standard is 22 years old. lighttpd has been using C99 for many, many years. This does not appear to be an issue with the source code distributed on this site by the lighttpd organization.
Please file this issue with the buildroot package maintainers. There are hundreds (thousands?) of OS distros. This is not the place to report issues for each OS distro.
Please file this issue with the buildroot package maintainers.
Fabrice is one of the buildroot package maintainers.
His analysis of the issue was however wrong. The problem stems from commit bb1d35dc17671bc308e25651b4f5fa0c3008cc69, which removed
AC_PROG_CC_STDC. This macro will expand to
-std=gnu99 on GCC versions that don't already default to C99 or later.
We happen to be able to work around the problem by re-generating the configure script, because we use autoconf 2.71, and that one expands
AC_PROG_CC to test for C11, C99 and C89 compiler flags and add the highest one automatically. Autoconf 2.69 only adds the one for C89.
Bottom line: to support older compilers that don't have C99 or later by default, you need to either regenerate the configure script with autoconf 2.71, or (probably better) add
- Status changed from Invalid to Patch Pending
- Target version set to 1.4.62
arnout Thank you for the correction.
The initial post said "so I assume that the configure provided in the official tarball has not been rebuilt after ...". While I do not have <fill in your distro here>, I downloaded the lighttpd release tarball on my system and verified that "./configure && make" worked just fine. I apologize that I do not have the time to assess all "my distro does not work" posts, as there are many, many, many more of such posts made by users than there are posts by maintainers.
The commit bb1d35dc identified by arnout is the output from running
autoupdate. I'll add
AC_PROG_CC_C99 as arnout suggested.
As an aside, if you detest autotools as much as I do, then if alternative build systems are supported by buildroot, you might consider building lighttpd with meson (as is done in OpenWRT and some others), or with CMake, or with SCons.
BTW, one of my test systems Fedora 35 has autoconf 2.69, automake 1.16.2, and libtool 2.4.6. When I downloaded the release tarball, unpacked, and built in a clean directory, lighttpd did not have any trouble building C99. As arnout noted, that is because the compiler defaults to (at least) C99. On Fedora 35, the compiler is gcc 11.2.1 and clang 13.0.0.
Also available in: Atom