summaryrefslogtreecommitdiffstats
path: root/gdb/configure
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2005-03-11 21:02:02 +0000
committerJim Blandy <jimb@codesourcery.com>2005-03-11 21:02:02 +0000
commita3b362c440ce898c2777e0b2a3d1684787f126a9 (patch)
tree332fc7746408f0e2ff3418f967443c56b7d68288 /gdb/configure
parent1f8ca57c49f1fec384b070c12c40fffcdd7f36fb (diff)
downloadppe42-binutils-a3b362c440ce898c2777e0b2a3d1684787f126a9.tar.gz
ppe42-binutils-a3b362c440ce898c2777e0b2a3d1684787f126a9.zip
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.
Diffstat (limited to 'gdb/configure')
-rwxr-xr-xgdb/configure15
1 files changed, 14 insertions, 1 deletions
diff --git a/gdb/configure b/gdb/configure
index d77ab938cb..d6a9e03450 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
OpenPOWER on IntegriCloud