From: Jim Blandy Date: Fri, 11 Mar 2005 21:02:02 +0000 (+0000) Subject: Avoid warnings due to the use of -Wuninitialized without -O. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a3b362c440ce898c2777e0b2a3d1684787f126a9;p=binutils-gdb.git Avoid warnings due to the use of -Wuninitialized without -O. * configure.ac (build_warnings): Include -Wuninitialized only if CFLAGS is unset at configure time, or CFLAGS is set and includes some -O option other than -O0. * configure: Regenerated. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3d2dc2ff6bb..a414ab091d1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2005-03-11 Jim Blandy + Avoid warnings due to the use of -Wuninitialized without -O. + * configure.ac (build_warnings): Include -Wuninitialized only if + CFLAGS is unset at configure time, or CFLAGS is set and includes + some -O option other than -O0. + * configure: Regenerated. + * mips-tdep.c (show_mips_abi): Change calling conventions to match those expected by add_setshow_enum_cmd. Use 'file' argument as appropriate. diff --git a/gdb/configure b/gdb/configure index d77ab938cbb..d6a9e03450e 100755 --- a/gdb/configure +++ b/gdb/configure @@ -19655,8 +19655,21 @@ fi; # NOTE: If you add to this list, remember to update # gdb/doc/gdbint.texinfo. build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \ --Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral \ +-Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral \ -Wunused-label -Wunused-function" + +# GCC supports -Wuninitialized only with -O or -On, n != 0. +if test x${CFLAGS+set} == xset; then + case "${CFLAGS}" in + *"-O0"* ) ;; + *"-O"* ) + build_warnings="${build_warnings} -Wuninitialized" + ;; + esac +else + build_warnings="${build_warnings} -Wuninitialized" +fi + # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs # -Wunused-function -Wunused-variable -Wunused-value # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual diff --git a/gdb/configure.ac b/gdb/configure.ac index 113159e412b..de30e6a88d9 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1088,8 +1088,21 @@ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) # NOTE: If you add to this list, remember to update # gdb/doc/gdbint.texinfo. build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \ --Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral \ +-Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral \ -Wunused-label -Wunused-function" + +# GCC supports -Wuninitialized only with -O or -On, n != 0. +if test x${CFLAGS+set} == xset; then + case "${CFLAGS}" in + *"-O0"* ) ;; + *"-O"* ) + build_warnings="${build_warnings} -Wuninitialized" + ;; + esac +else + build_warnings="${build_warnings} -Wuninitialized" +fi + # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs # -Wunused-function -Wunused-variable -Wunused-value # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual