diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-05-15 10:48:02 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-05-15 11:00:00 -0400 |
commit | be2bc30f9cb3e8dd8b566db551a8ce3cc305e015 (patch) | |
tree | b956da9b71b744d3600ee4a1a7817c4f92f3c2ba /sim/ppc/configure.ac | |
parent | c5a2e0123b7241be6a2022f1acb8fa700dda628a (diff) | |
download | binutils-be2bc30f9cb3e8dd8b566db551a8ce3cc305e015.zip binutils-be2bc30f9cb3e8dd8b566db551a8ce3cc305e015.tar.gz binutils-be2bc30f9cb3e8dd8b566db551a8ce3cc305e015.tar.bz2 |
sim: ppc: clean up various warnings
A random grab bag of minor fixes to enable -Werror for this port.
Cast address vars to long when the format was using %l.
Use %zu with sizeof operations.
Add const to a bunch of strings.
Trim unused variables.
Fix sizeof call to calculate target storage and not the pointer itself.
Diffstat (limited to 'sim/ppc/configure.ac')
-rw-r--r-- | sim/ppc/configure.ac | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac index 6482fba..21913a9 100644 --- a/sim/ppc/configure.ac +++ b/sim/ppc/configure.ac @@ -587,6 +587,23 @@ AC_DEFINE_UNQUOTED([WITH_TRACE], [$sim_trace], [Sim trace settings]) AC_MSG_RESULT($sim_trace) +AC_ARG_ENABLE(werror, + AS_HELP_STRING([--enable-werror], [treat compile warnings as errors]), + [case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;; + esac]) +# Enable -Werror by default when using gcc +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then + ERROR_ON_WARNING=yes +fi +WERROR_CFLAGS="" +if test "${ERROR_ON_WARNING}" = yes ; then + WERROR_CFLAGS="-Werror" +fi +AC_SUBST(WERROR_CFLAGS) + AC_ARG_ENABLE(sim-warnings, [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o], [case "${enableval}" in |