aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog8
-rw-r--r--sim/common/aclocal.m413
2 files changed, 20 insertions, 1 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index a22cc4f..a2ba15e 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,11 @@
+2005-02-28 Jim Blandy <jimb@redhat.com>
+
+ * aclocal.m4 (SIM_AC_OPTION_WARNINGS): Don't include
+ -Wuninitialized in the default list of build warnings if CFLAGS is
+ set, and doesn't include -O. (Using -Wuninitialized without
+ optimization produces a warning, which interferes with compilation
+ with -Werror.)
+
2005-02-21 Jim Blandy <jimb@redhat.com>
* callback.c (os_fstat): Don't declare 't' unless it's used.
diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4
index 07ae512..2f0d991 100644
--- a/sim/common/aclocal.m4
+++ b/sim/common/aclocal.m4
@@ -790,7 +790,18 @@ AC_DEFUN(SIM_AC_OPTION_WARNINGS,
# 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 -Wparentheses -Wpointer-arith"
+# 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-label -Wunused-variable -Wunused-value
# -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual