Re: best way to check for compiler _warnings_?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Miles,

* Miles Bader wrote on Mon, Nov 01, 2010 at 05:33:13AM CET:
> I want to check whether the compiler is giving a warning (about an
> unrecognized command-line option).
> 
> Since the compilation still succeeds, AC_COMPILE_IFELSE doesn't do the
> job...
> 
> e.g.:
> 
>    $ g++ -o /dev/null -catfood -c /tmp/s.cc ; echo $?
>    g++: unrecognized option '-catfood'
>    0

First, please complain to the compiler vendor (whoever is responsible
for the behavior).  FWIW, I can reproduce with Debian GCC 4.3.5 but not
with upstream FSF GCC from SVN.

Then, dealing with such behavior is tricky in general.  You can use
AC_LANG_WERROR, but it has problems if the compiler is verbose by
default.  Libtool has a couple of macros that test a compiler without
and with some flag and compare output of the two, but even that is of
limited reliability if the "normal" part of the output is noisy.  It's
a mess.

Cheers,
Ralf

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux