On 06/09/2014 09:59 AM, Kurt Schwehr wrote: > Eric, > > Thanks for the feedback. I definitely had the feeling that it would be > impossible to get rid of all warnings for all compilers. > > Two questions back at you: > > 1) Do you have a example of a source package that handles -Werror in a > clean way so that I can use it a s model try to add the same to these other > packages?
Sure. GNU coreutils: http://git.savannah.gnu.org/cgit/coreutils.git/tree/configure.ac#n108 http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/local.mk Note how it probes for -Werror separately from other flags, and sticks the result in a different variable for substitution at make time. At maketime, it then avoids -Werror for gnulib (which has a looser set of standards, and therefore fails some of the warning flags that coreutils turns on for itself), and enables -Werror for itself (all according to whether warnings-as-errors was requested based on configure options, which in turn have a default based on whether it detects a build from git sources or from a tarball). > > 2) Does the suggested fix I gave make sense? I think that means: a) It's > not going to break any environments without -Werror or equivalent for > compilers out there. b) It will generally reduce the number of > compilers/flag combinations that would issue a warning for this test? If > this proposed fix is a bad idea, why is it bad? Your fix is a one-liner, and easy to maintain, once you resubmit it without the syntax error of a missing (); so I see no reason against applying your patch. I'm just pointing out that expecting -Werror to work during configure is a lost cause, and that while we can apply simple patches, we cannot solve the inherent technical problem of being able to make ALL compilers warning-free. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature