mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 03:29:47 +08:00
sim: mn10300: enable -Werror
Now that all warnings are fixed in this port, enable -Werror by default.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2021-06-14 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* configure.ac: Delete all to SIM_AC_OPTION_WARNINGS.
|
||||||
|
* configure: Regenerate.
|
||||||
|
|
||||||
2021-06-14 Mike Frysinger <vapier@gentoo.org>
|
2021-06-14 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* mn10300.igen: Change abort to sim_engine_abort.
|
* mn10300.igen: Change abort to sim_engine_abort.
|
||||||
|
213
sim/mn10300/configure
vendored
213
sim/mn10300/configure
vendored
@ -769,12 +769,12 @@ enable_libtool_lock
|
|||||||
enable_maintainer_mode
|
enable_maintainer_mode
|
||||||
enable_sim_inline
|
enable_sim_inline
|
||||||
enable_sim_endian
|
enable_sim_endian
|
||||||
enable_werror
|
|
||||||
enable_build_warnings
|
|
||||||
enable_sim_build_warnings
|
|
||||||
enable_sim_reserved_bits
|
enable_sim_reserved_bits
|
||||||
enable_sim_bitsize
|
enable_sim_bitsize
|
||||||
enable_sim_hardware
|
enable_sim_hardware
|
||||||
|
enable_werror
|
||||||
|
enable_build_warnings
|
||||||
|
enable_sim_build_warnings
|
||||||
'
|
'
|
||||||
ac_precious_vars='build_alias
|
ac_precious_vars='build_alias
|
||||||
host_alias
|
host_alias
|
||||||
@ -1415,17 +1415,17 @@ Optional Features:
|
|||||||
Specify which functions should be inlined
|
Specify which functions should be inlined
|
||||||
--enable-sim-endian=endian
|
--enable-sim-endian=endian
|
||||||
Specify target byte endian orientation
|
Specify target byte endian orientation
|
||||||
--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
|
--enable-sim-reserved-bits
|
||||||
Specify whether to check reserved bits in
|
Specify whether to check reserved bits in
|
||||||
instruction
|
instruction
|
||||||
--enable-sim-bitsize=N Specify target bitsize (32 or 64)
|
--enable-sim-bitsize=N Specify target bitsize (32 or 64)
|
||||||
--enable-sim-hardware=LIST
|
--enable-sim-hardware=LIST
|
||||||
Specify the hardware to be included in the build.
|
Specify the hardware to be included in the build.
|
||||||
|
--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:
|
Optional Packages:
|
||||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||||
@ -11199,103 +11199,6 @@ fi
|
|||||||
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 -Werror $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"
|
default_sim_reserved_bits="1"
|
||||||
# Check whether --enable-sim-reserved-bits was given.
|
# Check whether --enable-sim-reserved-bits was given.
|
||||||
if test "${enable_sim_reserved_bits+set}" = set; then :
|
if test "${enable_sim_reserved_bits+set}" = set; then :
|
||||||
@ -11473,6 +11376,106 @@ 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=""
|
||||||
|
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 -Werror $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=""
|
cgen_breaks=""
|
||||||
if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
|
if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
|
||||||
cgen_breaks="break cgen_rtx_error";
|
cgen_breaks="break cgen_rtx_error";
|
||||||
|
@ -5,7 +5,6 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
|
|||||||
SIM_AC_COMMON
|
SIM_AC_COMMON
|
||||||
|
|
||||||
SIM_AC_OPTION_ENDIAN(LITTLE)
|
SIM_AC_OPTION_ENDIAN(LITTLE)
|
||||||
SIM_AC_OPTION_WARNINGS(no)
|
|
||||||
SIM_AC_OPTION_RESERVED_BITS
|
SIM_AC_OPTION_RESERVED_BITS
|
||||||
SIM_AC_OPTION_BITSIZE(32,31)
|
SIM_AC_OPTION_BITSIZE(32,31)
|
||||||
SIM_AC_OPTION_HARDWARE(mn103cpu mn103int mn103tim mn103ser mn103iop)
|
SIM_AC_OPTION_HARDWARE(mn103cpu mn103int mn103tim mn103ser mn103iop)
|
||||||
|
Reference in New Issue
Block a user