diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-09-08 20:58:03 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-09-08 21:02:25 -0400 |
commit | d0d2fb0a25517c39ecdec504c7a9a7943247cd86 (patch) | |
tree | 82cf7fbcf3f62e92cd006bc0c2c46a272370bab0 /sim | |
parent | 74e43bd231cb60d18930293e0eb9119058dffd40 (diff) | |
download | gdb-d0d2fb0a25517c39ecdec504c7a9a7943247cd86.zip gdb-d0d2fb0a25517c39ecdec504c7a9a7943247cd86.tar.gz gdb-d0d2fb0a25517c39ecdec504c7a9a7943247cd86.tar.bz2 |
sim: ppc: align format string settings with common code
This copies logic used in the common sim warning configure code to fix
build errors for mingw targets. Turning format warnings on triggers
a failure in the debug.c file, so apply a minor fix at the same time.
Diffstat (limited to 'sim')
-rwxr-xr-x | sim/ppc/configure | 6 | ||||
-rw-r--r-- | sim/ppc/configure.ac | 6 | ||||
-rw-r--r-- | sim/ppc/debug.c | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/sim/ppc/configure b/sim/ppc/configure index 0bab1af..2cb7ccd 100755 --- a/sim/ppc/configure +++ b/sim/ppc/configure @@ -3489,6 +3489,12 @@ sim_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith -Wno-pointer-sign -Wold-style-declaration -Wold-style-definition " +# Enable -Wno-format by default when using gcc on mingw since many +# GCC versions complain about %I64. +case "${host}" in + *-*-mingw32*) sim_warnings="$sim_warnings -Wno-format" ;; + *) sim_warnings="$sim_warnings -Wformat-nonliteral" ;; +esac # Check whether --enable-sim-warnings was given. if test "${enable_sim_warnings+set}" = set; then : enableval=$enable_sim_warnings; case "${enableval}" in diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac index 42ccda3..0fa7f4e 100644 --- a/sim/ppc/configure.ac +++ b/sim/ppc/configure.ac @@ -430,6 +430,12 @@ sim_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith -Wno-pointer-sign -Wold-style-declaration -Wold-style-definition " +# Enable -Wno-format by default when using gcc on mingw since many +# GCC versions complain about %I64. +case "${host}" in + *-*-mingw32*) sim_warnings="$sim_warnings -Wno-format" ;; + *) sim_warnings="$sim_warnings -Wformat-nonliteral" ;; +esac 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 diff --git a/sim/ppc/debug.c b/sim/ppc/debug.c index 53a392a..a9b48c3 100644 --- a/sim/ppc/debug.c +++ b/sim/ppc/debug.c @@ -140,7 +140,7 @@ trace_usage(int verbose) printf_filtered("\n"); } if (verbose > 1) { - const char *format = "\t%-18s%s\n"; + static const char format[] = "\t%-18s%s\n"; int i; printf_filtered(format, "all", "enable all the trace options"); for (i = 0; trace_description[i].option < nr_trace_options; i++) |