X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Fwarning.m4;h=6b846bf4ea32c953e259d4ebd6d875b890577db7;hb=fad072ac13b347994507f32882b557ab7b044a19;hp=b366cadeb29365e92156d87b3c800560c9d9730b;hpb=01f0fe5e0450edf168c1f612feb93cf588e4e7ea;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/warning.m4 b/bfd/warning.m4 index b366cadeb2..6b846bf4ea 100644 --- a/bfd/warning.m4 +++ b/bfd/warning.m4 @@ -2,6 +2,7 @@ dnl Common configure.in fragment AC_DEFUN([AM_BINUTILS_WARNINGS],[ GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +AC_EGREP_CPP([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow") AC_ARG_ENABLE(werror, [ --enable-werror treat compile warnings as errors], @@ -11,6 +12,16 @@ AC_ARG_ENABLE(werror, *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;; esac]) +# Disable -Wformat by default when using gcc on mingw +case "${host}" in + *-*-mingw32*) + if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then + GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" + fi + ;; + *) ;; +esac + # Enable -Werror by default when using gcc if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then ERROR_ON_WARNING=yes