diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-01-09 14:16:10 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-01-11 09:13:11 -0500 |
commit | 5c1008a41f1b97e8c7abb21eb2de0205e9a30521 (patch) | |
tree | 54cabb32e5c04936cc2d7896c962a5280ec4260f /sim | |
parent | a0c38f0d705129e14c025de814d7fd619edde650 (diff) | |
download | gdb-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')
-rw-r--r-- | sim/bpf/ChangeLog | 5 | ||||
-rwxr-xr-x | sim/bpf/configure | 109 | ||||
-rw-r--r-- | sim/bpf/configure.ac | 1 | ||||
-rw-r--r-- | sim/erc32/ChangeLog | 5 | ||||
-rwxr-xr-x | sim/erc32/configure | 109 | ||||
-rw-r--r-- | sim/erc32/configure.ac | 1 | ||||
-rw-r--r-- | sim/frv/ChangeLog | 5 | ||||
-rwxr-xr-x | sim/frv/configure | 109 | ||||
-rw-r--r-- | sim/frv/configure.ac | 1 | ||||
-rw-r--r-- | sim/h8300/ChangeLog | 5 | ||||
-rwxr-xr-x | sim/h8300/configure | 109 | ||||
-rw-r--r-- | sim/h8300/configure.ac | 1 | ||||
-rw-r--r-- | sim/iq2000/ChangeLog | 5 | ||||
-rwxr-xr-x | sim/iq2000/configure | 109 | ||||
-rw-r--r-- | sim/iq2000/configure.ac | 1 | ||||
-rw-r--r-- | sim/lm32/ChangeLog | 5 | ||||
-rwxr-xr-x | sim/lm32/configure | 109 | ||||
-rw-r--r-- | sim/lm32/configure.ac | 1 | ||||
-rw-r--r-- | sim/m32r/ChangeLog | 5 | ||||
-rwxr-xr-x | sim/m32r/configure | 109 | ||||
-rw-r--r-- | sim/m32r/configure.ac | 1 | ||||
-rw-r--r-- | sim/or1k/ChangeLog | 5 | ||||
-rwxr-xr-x | sim/or1k/configure | 109 | ||||
-rw-r--r-- | sim/or1k/configure.ac | 1 | ||||
-rw-r--r-- | sim/rl78/ChangeLog | 5 | ||||
-rwxr-xr-x | sim/rl78/configure | 109 | ||||
-rw-r--r-- | sim/rl78/configure.ac | 1 | ||||
-rw-r--r-- | sim/rx/ChangeLog | 5 | ||||
-rwxr-xr-x | sim/rx/configure | 109 | ||||
-rw-r--r-- | sim/rx/configure.ac | 1 |
30 files changed, 1130 insertions, 20 deletions
diff --git a/sim/bpf/ChangeLog b/sim/bpf/ChangeLog index b08642f..24ed05e 100644 --- a/sim/bpf/ChangeLog +++ b/sim/bpf/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. 2021-01-09 Mike Frysinger <vapier@gentoo.org> diff --git a/sim/bpf/configure b/sim/bpf/configure index cad42b2..52d64ce 100755 --- a/sim/bpf/configure +++ b/sim/bpf/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 ' ac_precious_vars='build_alias @@ -1448,6 +1451,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 Optional Packages: @@ -12934,7 +12942,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12937 "configure" +#line 12945 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13040,7 +13048,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13043 "configure" +#line 13051 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13777,6 +13785,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/bpf/configure.ac b/sim/bpf/configure.ac index e7cd72a..e9df51a 100644 --- a/sim/bpf/configure.ac +++ b/sim/bpf/configure.ac @@ -9,6 +9,7 @@ SIM_AC_OPTION_ENDIAN([], [LITTLE]) SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT) SIM_AC_OPTION_SCACHE(16384) SIM_AC_OPTION_DEFAULT_MODEL([bpf-def]) +SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_CGEN_MAINT SIM_AC_OUTPUT diff --git a/sim/erc32/ChangeLog b/sim/erc32/ChangeLog index d169de8..68599f7 100644 --- a/sim/erc32/ChangeLog +++ b/sim/erc32/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. * sis.c: Delete HAVE_STDLIB_H. diff --git a/sim/erc32/configure b/sim/erc32/configure index 360cffb..71558e1 100755 --- a/sim/erc32/configure +++ b/sim/erc32/configure @@ -782,6 +782,9 @@ enable_sim_environment enable_sim_inline with_pkgversion with_bugurl +enable_werror +enable_build_warnings +enable_sim_build_warnings ' ac_precious_vars='build_alias host_alias @@ -1431,6 +1434,11 @@ Optional Features: environment --enable-sim-inline=inlines Specify which functions should be inlined + --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 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -12916,7 +12924,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12919 "configure" +#line 12927 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13022,7 +13030,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13025 "configure" +#line 13033 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13573,6 +13581,103 @@ _ACEOF +# 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 + + # In the Cygwin environment, we need some additional flags. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cygwin" >&5 $as_echo_n "checking for cygwin... " >&6; } diff --git a/sim/erc32/configure.ac b/sim/erc32/configure.ac index 2317d47..2c81b84 100644 --- a/sim/erc32/configure.ac +++ b/sim/erc32/configure.ac @@ -18,6 +18,7 @@ AC_INIT(Makefile.in) sinclude(../common/acinclude.m4) SIM_AC_COMMON +SIM_AC_OPTION_WARNINGS(no) # In the Cygwin environment, we need some additional flags. AC_CACHE_CHECK([for cygwin], sim_cv_os_cygwin, 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 # diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index f6dd484..1f9281f 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/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. * compile.c: Delete HAVE_TIME_H & HAVE_STDLIB_H. diff --git a/sim/h8300/configure b/sim/h8300/configure index 34c63bf..5254a36 100755 --- a/sim/h8300/configure +++ b/sim/h8300/configure @@ -782,6 +782,9 @@ with_pkgversion with_bugurl enable_sim_endian enable_sim_alignment +enable_werror +enable_build_warnings +enable_sim_build_warnings ' ac_precious_vars='build_alias host_alias @@ -1436,6 +1439,11 @@ Optional Features: --enable-sim-alignment=align Specify strict, nonstrict or forced alignment of memory accesses + --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 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -12921,7 +12929,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12924 "configure" +#line 12932 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13027,7 +13035,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13030 "configure" +#line 13038 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13670,6 +13678,103 @@ fi 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 + + for ac_header in sys/param.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" diff --git a/sim/h8300/configure.ac b/sim/h8300/configure.ac index d2ee926..8caacad 100644 --- a/sim/h8300/configure.ac +++ b/sim/h8300/configure.ac @@ -6,6 +6,7 @@ SIM_AC_COMMON SIM_AC_OPTION_ENDIAN(BIG) SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT) +SIM_AC_OPTION_WARNINGS(no) AC_CHECK_HEADERS(sys/param.h) diff --git a/sim/iq2000/ChangeLog b/sim/iq2000/ChangeLog index 7346cbd..f609759 100644 --- a/sim/iq2000/ChangeLog +++ b/sim/iq2000/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. * sim-if.c: Delete HAVE_STDLIB_H. diff --git a/sim/iq2000/configure b/sim/iq2000/configure index d16aeee..cd7acea 100755 --- a/sim/iq2000/configure +++ b/sim/iq2000/configure @@ -787,6 +787,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_hardware ' @@ -1447,6 +1450,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-hardware=LIST Specify the hardware to be included in the build. @@ -12935,7 +12943,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12938 "configure" +#line 12946 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13041,7 +13049,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13044 "configure" +#line 13052 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13719,6 +13727,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/iq2000/configure.ac b/sim/iq2000/configure.ac index 6b9f363..4a1b28b 100644 --- a/sim/iq2000/configure.ac +++ b/sim/iq2000/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(iq2000) +SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_CGEN_MAINT SIM_AC_OPTION_HARDWARE(yes,"","") diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog index 4796212..0c93128 100644 --- a/sim/lm32/ChangeLog +++ b/sim/lm32/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. * sim-if.c: Delete HAVE_STDLIB_H. diff --git a/sim/lm32/configure b/sim/lm32/configure index fa59d92..8f5aae6 100755 --- a/sim/lm32/configure +++ b/sim/lm32/configure @@ -787,6 +787,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_hardware ' @@ -1447,6 +1450,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-hardware=LIST Specify the hardware to be included in the build. @@ -12935,7 +12943,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12938 "configure" +#line 12946 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13041,7 +13049,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13044 "configure" +#line 13052 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13719,6 +13727,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/lm32/configure.ac b/sim/lm32/configure.ac index 82240ff..7da76d9 100644 --- a/sim/lm32/configure.ac +++ b/sim/lm32/configure.ac @@ -8,6 +8,7 @@ SIM_AC_OPTION_ENDIAN(BIG) SIM_AC_OPTION_ALIGNMENT(STRICT_ALIGNMENT,STRICT_ALIGNMENT) SIM_AC_OPTION_SCACHE(16384) SIM_AC_OPTION_DEFAULT_MODEL(lm32) +SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_CGEN_MAINT SIM_AC_OPTION_HARDWARE(yes,,lm32cpu lm32timer lm32uart) diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index dd4bba9..551e12b 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/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. * sim-if.c: Delete HAVE_STRING_H, HAVE_STRINGS_H, HAVE_STDLIB_H, and strings.h include. diff --git a/sim/m32r/configure b/sim/m32r/configure index 5b73aa5..efcaed9 100755 --- a/sim/m32r/configure +++ b/sim/m32r/configure @@ -789,6 +789,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_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-hardware=LIST Specify the hardware to be included in the build. @@ -12937,7 +12945,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12940 "configure" +#line 12948 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13043,7 +13051,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13046 "configure" +#line 13054 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13721,6 +13729,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/m32r/configure.ac b/sim/m32r/configure.ac index 6020a5c..e74a8a5 100644 --- a/sim/m32r/configure.ac +++ b/sim/m32r/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(m32r/d) +SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_CGEN_MAINT case "${target_alias}" in diff --git a/sim/or1k/ChangeLog b/sim/or1k/ChangeLog index 1b7e6e2..016ffd0 100644 --- a/sim/or1k/ChangeLog +++ b/sim/or1k/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> + * sim-main.h: Include config.h. 2021-01-11 Mike Frysinger <vapier@gentoo.org> diff --git a/sim/or1k/configure b/sim/or1k/configure index 538011c..8d8746e 100755 --- a/sim/or1k/configure +++ b/sim/or1k/configure @@ -788,6 +788,9 @@ enable_sim_alignment enable_sim_bitsize enable_sim_scache enable_sim_default_model +enable_werror +enable_build_warnings +enable_sim_build_warnings enable_cgen_maint ' ac_precious_vars='build_alias @@ -1448,6 +1451,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 Optional Packages: @@ -12934,7 +12942,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12937 "configure" +#line 12945 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13040,7 +13048,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13043 "configure" +#line 13051 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13777,6 +13785,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 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking default sim environment setting" >&5 $as_echo_n "checking default sim environment setting... " >&6; } sim_environment="ALL_ENVIRONMENT" diff --git a/sim/or1k/configure.ac b/sim/or1k/configure.ac index aa7c400..19a1da3 100644 --- a/sim/or1k/configure.ac +++ b/sim/or1k/configure.ac @@ -9,6 +9,7 @@ SIM_AC_OPTION_ALIGNMENT(STRICT_ALIGNMENT) SIM_AC_OPTION_BITSIZE([32], [31], [32]) SIM_AC_OPTION_SCACHE(16384) SIM_AC_OPTION_DEFAULT_MODEL([or1200]) +SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_ENVIRONMENT SIM_AC_OPTION_INLINE() SIM_AC_OPTION_CGEN_MAINT diff --git a/sim/rl78/ChangeLog b/sim/rl78/ChangeLog index ec31614..ddce236 100644 --- a/sim/rl78/ChangeLog +++ b/sim/rl78/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> + * cpu.h (pc): Change to an extern. * cpu.c (pc): Define. diff --git a/sim/rl78/configure b/sim/rl78/configure index 24de7d6..842091b 100755 --- a/sim/rl78/configure +++ b/sim/rl78/configure @@ -780,6 +780,9 @@ enable_sim_environment enable_sim_inline with_pkgversion with_bugurl +enable_werror +enable_build_warnings +enable_sim_build_warnings ' ac_precious_vars='build_alias host_alias @@ -1429,6 +1432,11 @@ Optional Features: environment --enable-sim-inline=inlines Specify which functions should be inlined + --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 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -12914,7 +12922,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12917 "configure" +#line 12925 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13020,7 +13028,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13023 "configure" +#line 13031 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13571,6 +13579,103 @@ _ACEOF +# 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 + + for ac_header in getopt.h do : ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" diff --git a/sim/rl78/configure.ac b/sim/rl78/configure.ac index b44d1da..65bb407 100644 --- a/sim/rl78/configure.ac +++ b/sim/rl78/configure.ac @@ -22,6 +22,7 @@ AC_INIT(Makefile.in) sinclude(../common/acinclude.m4) SIM_AC_COMMON +SIM_AC_OPTION_WARNINGS(no) AC_CHECK_HEADERS(getopt.h) diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog index 79b4e99..684c38a 100644 --- a/sim/rx/ChangeLog +++ b/sim/rx/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. * main.c: Delete HAVE_STDLIB_H. diff --git a/sim/rx/configure b/sim/rx/configure index 447a252..3969c67 100755 --- a/sim/rx/configure +++ b/sim/rx/configure @@ -780,6 +780,9 @@ enable_sim_environment enable_sim_inline with_pkgversion with_bugurl +enable_werror +enable_build_warnings +enable_sim_build_warnings enable_cycle_accurate enable_cycle_stats ' @@ -1431,6 +1434,11 @@ Optional Features: environment --enable-sim-inline=inlines Specify which functions should be inlined + --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 --disable-cycle-accurate Disable cycle accurate simulation (faster runtime) --disable-cycle-stats Disable cycle statistics (faster runtime) @@ -12919,7 +12927,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12922 "configure" +#line 12930 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13025,7 +13033,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13028 "configure" +#line 13036 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13576,6 +13584,103 @@ _ACEOF +# 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 + + for ac_header in getopt.h do : ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" diff --git a/sim/rx/configure.ac b/sim/rx/configure.ac index 1bdb5ab..6c14434 100644 --- a/sim/rx/configure.ac +++ b/sim/rx/configure.ac @@ -22,6 +22,7 @@ AC_INIT(Makefile.in) sinclude(../common/acinclude.m4) SIM_AC_COMMON +SIM_AC_OPTION_WARNINGS(no) AC_CHECK_HEADERS(getopt.h) |