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 | |
parent | c5a2e0123b7241be6a2022f1acb8fa700dda628a (diff) | |
download | gdb-be2bc30f9cb3e8dd8b566db551a8ce3cc305e015.zip gdb-be2bc30f9cb3e8dd8b566db551a8ce3cc305e015.tar.gz gdb-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')
-rwxr-xr-x | sim/ppc/configure | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sim/ppc/configure b/sim/ppc/configure index 3de2ba8..235595b 100755 --- a/sim/ppc/configure +++ b/sim/ppc/configure @@ -678,6 +678,7 @@ build REPORT_BUGS_TEXI REPORT_BUGS_TO PKGVERSION +WERROR_CFLAGS EGREP GREP CPP @@ -773,6 +774,7 @@ enable_sim_stdio enable_sim_switch enable_sim_timebase enable_sim_trace +enable_werror enable_sim_warnings enable_sim_xor_endian with_pkgversion @@ -1435,6 +1437,7 @@ Optional Features: --enable-sim-switch Use a switch instead of a table for instruction call. --enable-sim-timebase Specify whether the PPC timebase is supported. --enable-sim-trace Specify whether tracing is supported. + --enable-werror treat compile warnings as errors --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8). --enable-plugins Enable support for plugins @@ -4758,6 +4761,25 @@ _ACEOF $as_echo "$sim_trace" >&6; } +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;; + esac +fi + +# 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 + + # Check whether --enable-sim-warnings was given. if test "${enable_sim_warnings+set}" = set; then : enableval=$enable_sim_warnings; case "${enableval}" in |