On 01/03/2014 02:56 PM, Eric Blake wrote: > On 01/03/2014 02:51 PM, Vincent Lefevre wrote: >> A developer may want to test his software with >> -Werror=old-style-definition (in particular because such definitions >> could be a real bug in the software). But configure fails because >> autoconf (version 2.69) generates such a function definition. > > Read the list archives. We have repeatedly said that anyone running > ./configure CFLAGS=-Werror is asking for problems, because we CANNOT > guarantee warning-free compilation across all versions of all compilers. > The only SANE way to use -Werror in configure is to probe whether it > exists, and then add it to a secondary make variable that you then > append to your source files (where it does make sense), while still > leaving CFLAGS untainted so that configure doesn't trip over (sometimes > intentional) warnings. > > The bug is not in autoconf, but in your programs for polluting CFLAGS. > > That said, if someone has the time and inclination to write a patch that > would make autoconf automatically strip out -Werror* arguments from > CFLAGS for the duration of the configure testing, then add it back in at > the end, be my guest.
Also, for your PARTICULAR case of wanting to use main(void) instead of main() throughoug would make sense, particularly since we continue to move away from K&R C support, can pretty much assume a minimum C89 support on all viable modern porting targets, and have even toggled the default to preferring C11 or C99 over C89 when probing for a C compiler of unspecified version. Furthermore, at least AC_PROG_LEX already uses main(void), and no one has complained of that test tripping up a wrong configure test because of a compiler that could not parse it. So a simpler patch that fixes all of autoconf to use main(void) instead of main() is fair game for immediate inclusion. Do you have time to write such a patch, instead of waiting on me? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature