diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-01-31 15:17:18 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-01-31 15:19:16 -0500 |
commit | 5f05936d9b14d2a75eaea7cc396052de268f8503 (patch) | |
tree | 3ea7565eb6edcddbe30f846a33bda535ad8d3aa0 /sim | |
parent | 44b30b7f0e6fccb3fc678c84a8c2ad7d19b4a679 (diff) | |
download | gdb-5f05936d9b14d2a75eaea7cc396052de268f8503.zip gdb-5f05936d9b14d2a75eaea7cc396052de268f8503.tar.gz gdb-5f05936d9b14d2a75eaea7cc396052de268f8503.tar.bz2 |
sim: v850: cleanup build warnings
This port only had one minor warning left in it, so fix it and then
enable -Werror behavior by deleting the macro call. We'll use the
common default now (which is -Werror).
Diffstat (limited to 'sim')
-rw-r--r-- | sim/v850/ChangeLog | 6 | ||||
-rwxr-xr-x | sim/v850/configure | 223 | ||||
-rw-r--r-- | sim/v850/configure.ac | 1 | ||||
-rw-r--r-- | sim/v850/simops.c | 1 |
4 files changed, 124 insertions, 107 deletions
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog index b7b2cfd..6be68b3 100644 --- a/sim/v850/ChangeLog +++ b/sim/v850/ChangeLog @@ -1,5 +1,11 @@ 2021-01-31 Mike Frysinger <vapier@gentoo.org> + * simops.c: Include stdlib.h. + * configure.ac (SIM_AC_OPTION_WARNINGS): Delete call. + * configure: Regenerate. + +2021-01-31 Mike Frysinger <vapier@gentoo.org> + * simops.c (OP_10007E0): Change reterr to RETERR. 2021-01-30 Mike Frysinger <vapier@gentoo.org> diff --git a/sim/v850/configure b/sim/v850/configure index a8a5aa3..d0f21da 100755 --- a/sim/v850/configure +++ b/sim/v850/configure @@ -782,11 +782,11 @@ with_pkgversion with_bugurl enable_sim_endian enable_sim_alignment +enable_sim_reserved_bits +enable_sim_bitsize enable_werror enable_build_warnings enable_sim_build_warnings -enable_sim_reserved_bits -enable_sim_bitsize ' ac_precious_vars='build_alias host_alias @@ -1441,15 +1441,15 @@ Optional Features: --enable-sim-alignment=align Specify strict, nonstrict or forced alignment of memory accesses + --enable-sim-reserved-bits + Specify whether to check reserved bits in + instruction + --enable-sim-bitsize=N Specify target bitsize (32 or 64) --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-sim-reserved-bits - Specify whether to check reserved bits in - instruction - --enable-sim-bitsize=N Specify target bitsize (32 or 64) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -6911,7 +6911,15 @@ fi test -z "$AR" && AR=ar if test -n "$plugin_option"; then if $AR --help 2>&1 | grep -q "\--plugin"; then - AR="$AR $plugin_option" + touch conftest.c + $AR $plugin_option rc conftest.a conftest.c + if test "$?" != 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} + else + AR="$AR $plugin_option" + fi + rm -f conftest.* fi fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -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 @@ -13684,103 +13692,6 @@ 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 - - default_sim_reserved_bits="1" # Check whether --enable-sim-reserved-bits was given. if test "${enable_sim_reserved_bits+set}" = set; then : @@ -13882,6 +13793,106 @@ done +# 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 + +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_breaks="" if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then cgen_breaks="break cgen_rtx_error"; diff --git a/sim/v850/configure.ac b/sim/v850/configure.ac index 31bca40..25350d9 100644 --- a/sim/v850/configure.ac +++ b/sim/v850/configure.ac @@ -6,7 +6,6 @@ SIM_AC_COMMON SIM_AC_OPTION_ENDIAN(LITTLE) SIM_AC_OPTION_ALIGNMENT(,NONSTRICT_ALIGNMENT) -SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_RESERVED_BITS SIM_AC_OPTION_BITSIZE(32,31) diff --git a/sim/v850/simops.c b/sim/v850/simops.c index 421afee..bd23f92 100644 --- a/sim/v850/simops.c +++ b/sim/v850/simops.c @@ -11,6 +11,7 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif +#include <stdlib.h> #include <string.h> #include "targ-vals.h" |