Re: [PATCH] Compilation warnings, configure
On Wed, 4 Apr 2007 09:50, grobian@xxxxxxxxxxxxxx said:
> I just think -Werror can be useful. Whether you add it using a
> --enable-werror or some variable that you can set yourself doesn't
FWIW, you may use code like this to test for gcc features:
if test "$GCC" = yes; then
# Note that it is okay to use CFLAGS here because these are just
# warning options and the user should have a chance of overriding
# them.
AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wno-pointer-sign"
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
AC_MSG_RESULT($_gcc_psign)
CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_psign" = xyes ; then
CFLAGS="$CFLAGS -Wno-pointer-sign"
fi
fi
Shalom-Salam,
Werner