aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-01-09 01:16:11 -0500
committerMike Frysinger <vapier@gentoo.org>2021-01-09 09:19:37 -0500
commitbf470982f998b2b18545cc335f469a20e457acdd (patch)
tree9d11918cdd5c02cdcff059b29005e05c6b616dee /sim/common
parent0a94990bf64a82bdf73960fec1b47fef7c6a6ced (diff)
downloadgdb-bf470982f998b2b18545cc335f469a20e457acdd.zip
gdb-bf470982f998b2b18545cc335f469a20e457acdd.tar.gz
gdb-bf470982f998b2b18545cc335f469a20e457acdd.tar.bz2
sim: enable -Werror by default for some arches
We've had this off for a long time because the sim code was way too full of warnings for it to be feasible. However, I've cleaned things up significantly from when this was first merged, and we can start to turn this around. Change the macro to enable -Werror by default, and allow ports to opt out. New ports will get it automatically (and we can push back on them if they try to turn it off). Also turn it off for the few ports that still hit warnings for me. All the rest will get the new default, and we'll wait for feedback if/when new issues come up.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/acinclude.m411
2 files changed, 11 insertions, 5 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 28284ff..fea1ab2 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,10 @@
2021-01-09 Mike Frysinger <vapier@gentoo.org>
+ * acinclude.m4 (SIM_AC_OPTION_WARNINGS): Document 1st argument.
+ Set WERROR_CFLAGS when first arg is not set or is "yes".
+
+2021-01-09 Mike Frysinger <vapier@gentoo.org>
+
* hw-base.c (full_name_of_hw): Delete full_name. Replace
hw_strdup call with hw_malloc.
diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4
index 49d56b9..65afb42 100644
--- a/sim/common/acinclude.m4
+++ b/sim/common/acinclude.m4
@@ -737,6 +737,7 @@ AC_MSG_RESULT($sim_smp)
dnl --enable-build-warnings is for developers of the simulator.
dnl it enables extra GCC specific warnings.
+dnl arg[1] Enable -Werror by default? ("yes" or "no")
AC_DEFUN([SIM_AC_OPTION_WARNINGS],
[
AC_ARG_ENABLE(werror,
@@ -753,11 +754,11 @@ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
fi
WERROR_CFLAGS=""
-if test "${ERROR_ON_WARNING}" = yes ; then
-# NOTE: Disabled in the sim dir due to most sims generating warnings.
-# WERROR_CFLAGS="-Werror"
- true
-fi
+m4_if(m4_default([$1], [yes]), [yes], [dnl
+ if test "${ERROR_ON_WARNING}" = yes ; then
+ WERROR_CFLAGS="-Werror"
+ fi
+])dnl
build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
-Wpointer-sign \