On 03/29/2012 07:36 AM, Akim Demaille wrote: > For Bison I would like to test C and C++ warnings > in two different batches. Currently the macro does > not depend on the language to store its result, and > it does not try to compile, just to preprocess. >
> * m4/warnings.m4 (gl_WARN_ADD): Use the compiler, not the > preprocessor. > Depend on the current AC_LANG for the cache variables. Both of these changes make sense, since some warnings are language-dependent, and the preprocessor can't filter out which language you meant. I've pushed your patch after testing that it still picked up compiler warnings when used with libvirt. > > > FWIW I used to use a generic scheme, where I checked the > stderr of the compiler to see if the option was really > accepted: in some case (e.g., GCC) the compiler will > accept the option ($? = 0) yet it will constantly complain > about its uses. Is there interest in this approach? gcc 4.7 appears to have modified things even more - my experience is that it silently ignores unknown -Woptions if the rest of the program is warning-free, but the moment you have a warning about bad code, you _also_ get a warning about the unknown option. Checking stderr is risky, but if it lets us more accurately filter things, I'd welcome an additional patch to at least debate whether to include it. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature