aboutsummaryrefslogtreecommitdiff
path: root/sim/frv
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-01-09 14:16:10 -0500
committerMike Frysinger <vapier@gentoo.org>2021-01-11 09:13:11 -0500
commit5c1008a41f1b97e8c7abb21eb2de0205e9a30521 (patch)
tree54cabb32e5c04936cc2d7896c962a5280ec4260f /sim/frv
parenta0c38f0d705129e14c025de814d7fd619edde650 (diff)
downloadgdb-5c1008a41f1b97e8c7abb21eb2de0205e9a30521.zip
gdb-5c1008a41f1b97e8c7abb21eb2de0205e9a30521.tar.gz
gdb-5c1008a41f1b97e8c7abb21eb2de0205e9a30521.tar.bz2
sim: call SIM_AC_OPTION_WARNINGS(no) in remaining ports
We want all ports to opt into extra warnings as the default compiler settings lets a lot slide. Opt all the ports that haven't already in to the warning system. None of them build with -Werror, so disable that by default. Hopefully someone finds these important enough to start fixing at some point.
Diffstat (limited to 'sim/frv')
-rw-r--r--sim/frv/ChangeLog5
-rwxr-xr-xsim/frv/configure109
-rw-r--r--sim/frv/configure.ac1
3 files changed, 113 insertions, 2 deletions
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index 9022879..5fa0362 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,5 +1,10 @@
2021-01-11 Mike Frysinger <vapier@gentoo.org>
+ * configure.ac: Call SIM_AC_OPTION_WARNINGS.
+ * configure: Regenerate.
+
+2021-01-11 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
* options.c, sim-if.c: Delete HAVE_STRING_H, HAVE_STRINGS_H,
HAVE_STDLIB_H, and strings.h include.
diff --git a/sim/frv/configure b/sim/frv/configure
index d10ca4b..dd0cf46 100755
--- a/sim/frv/configure
+++ b/sim/frv/configure
@@ -788,6 +788,9 @@ enable_sim_endian
enable_sim_alignment
enable_sim_scache
enable_sim_default_model
+enable_werror
+enable_build_warnings
+enable_sim_build_warnings
enable_cgen_maint
enable_sim_trapdump
enable_sim_hardware
@@ -1449,6 +1452,11 @@ Optional Features:
Specify simulator execution cache size
--enable-sim-default-model=model
Specify default model to simulate
+ --enable-werror treat compile warnings as errors
+ --enable-build-warnings enable build-time compiler warnings if gcc is used
+ --enable-sim-build-warnings
+ enable SIM specific build-time compiler warnings if
+ gcc is used
--enable-cgen-maint=DIR build cgen generated files
--enable-sim-trapdump Make unknown traps dump the registers
--enable-sim-hardware=LIST
@@ -12938,7 +12946,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12941 "configure"
+#line 12949 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13044,7 +13052,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 13047 "configure"
+#line 13055 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13722,6 +13730,103 @@ fi
+# 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=""
+
+build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
+-Wpointer-sign \
+-Wno-unused -Wunused-value -Wunused-function \
+-Wno-switch -Wno-char-subscripts -Wmissing-prototypes
+-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \
+-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*) build_warnings="$build_warnings -Wno-format" ;;
+ *) build_warnings="$build_warnings -Wformat-nonliteral" ;;
+esac
+
+# Check whether --enable-build-warnings was given.
+if test "${enable_build_warnings+set}" = set; then :
+ enableval=$enable_build_warnings; case "${enableval}" in
+ yes) ;;
+ no) build_warnings="-w";;
+ ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
+ build_warnings="${build_warnings} ${t}";;
+ *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
+ build_warnings="${t} ${build_warnings}";;
+ *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+ echo "Setting compiler warning flags = $build_warnings" 6>&1
+fi
+fi
+# Check whether --enable-sim-build-warnings was given.
+if test "${enable_sim_build_warnings+set}" = set; then :
+ enableval=$enable_sim_build_warnings; case "${enableval}" in
+ yes) ;;
+ no) build_warnings="-w";;
+ ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
+ build_warnings="${build_warnings} ${t}";;
+ *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
+ build_warnings="${t} ${build_warnings}";;
+ *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+ echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
+fi
+fi
+WARN_CFLAGS=""
+if test "x${build_warnings}" != x -a "x$GCC" = xyes
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5
+$as_echo_n "checking compiler warning flags... " >&6; }
+ # Separate out the -Werror flag as some files just cannot be
+ # compiled with it enabled.
+ for w in ${build_warnings}; do
+ case $w in
+ -Werr*) WERROR_CFLAGS=-Werror ;;
+ *) # Check that GCC accepts it
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $w"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ WARN_CFLAGS="${WARN_CFLAGS} $w"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$saved_CFLAGS"
+ esac
+ done
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5
+$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
+fi
+
+
cgen_maint=no
cgen=guile
cgendir='$(srcdir)/../../cgen'
diff --git a/sim/frv/configure.ac b/sim/frv/configure.ac
index cb3cc14..5588533 100644
--- a/sim/frv/configure.ac
+++ b/sim/frv/configure.ac
@@ -8,6 +8,7 @@ SIM_AC_OPTION_ENDIAN(BIG)
SIM_AC_OPTION_ALIGNMENT(STRICT_ALIGNMENT)
SIM_AC_OPTION_SCACHE(16384)
SIM_AC_OPTION_DEFAULT_MODEL(fr500)
+SIM_AC_OPTION_WARNINGS(no)
SIM_AC_OPTION_CGEN_MAINT
#