diff options
author | Nick Clifton <nickc@redhat.com> | 2005-03-16 16:17:14 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2005-03-16 16:17:14 +0000 |
commit | 6aeed3908c885486dcbfc00681cb0f964022a5a4 (patch) | |
tree | 76bce4001bdf32444dd9d1f1160db362340d206c | |
parent | b75101b7f6a277c2370fd3fc73f5658002d07057 (diff) | |
download | gdb-6aeed3908c885486dcbfc00681cb0f964022a5a4.tar.gz |
Enable -Werror by default
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rwxr-xr-x | bfd/configure | 23 | ||||
-rw-r--r-- | bfd/configure.in | 16 | ||||
-rw-r--r-- | opcodes/ChangeLog | 8 | ||||
-rwxr-xr-x | opcodes/configure | 23 | ||||
-rw-r--r-- | opcodes/configure.in | 16 |
6 files changed, 92 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9c6969d869c..edd7edae4dc 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,4 +1,12 @@ 2005-03-16 Nick Clifton <nickc@redhat.com> + Ben Elliston <bje@au.ibm.com> + + * configure.in (error-on-warning): New switch: Add -Werror to the + compiler command line. Enabled by default. Disable via + --disable-error-on-warning. + * configure: Regenerate. + +2005-03-16 Nick Clifton <nickc@redhat.com> * ecoff.c: Convert to ISO C90 formatting. diff --git a/bfd/configure b/bfd/configure index 8ae9afeed9f..61afe156356 100755 --- a/bfd/configure +++ b/bfd/configure @@ -859,6 +859,7 @@ Optional Features: --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) --enable-targets alternative target configurations --enable-commonbfdlib build shared BFD/opcodes/libiberty library + --enable-error-on-warning treat compile warnings as errors --enable-build-warnings Enable build-time compiler warnings if gcc is used --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer @@ -3974,7 +3975,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 3977 "configure"' > conftest.$ac_ext + echo '#line 3978 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4263,6 +4264,26 @@ else want_mmap=false fi; build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" + +# Check whether --enable-error-on-warning or --disable-error-on-warning was given. +if test "${enable_error_on_warning+set}" = set; then + enableval="$enable_error_on_warning" + case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-error-on-warning" >&5 +echo "$as_me: error: bad value ${enableval} for --enable-error-on-warning" >&2;} + { (exit 1); exit 1; }; } ;; + esac +fi; + +# Enable -Werror by default, suppressing it only for --disable-error-on-warning +# or --disable-build-warnings. +if test "${ERROR_ON_WARNING}" != no +then + build_warnings="$build_warnings -Werror" +fi + # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" diff --git a/bfd/configure.in b/bfd/configure.in index a61bf62324c..afcae656b1e 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -52,6 +52,22 @@ AC_ARG_WITH(mmap, esac],[want_mmap=false])dnl build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" + +AC_ARG_ENABLE(error-on-warning, + [ --enable-error-on-warning treat compile warnings as errors], + [case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;; + esac]) + +# Enable -Werror by default, suppressing it only for --disable-error-on-warning +# or --disable-build-warnings. +if test "${ERROR_ON_WARNING}" != no +then + build_warnings="$build_warnings -Werror" +fi + AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 8daeebc391c..0bf8a20aa01 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,11 @@ +2005-03-16 Nick Clifton <nickc@redhat.com> + Ben Elliston <bje@au.ibm.com> + + * configure.in (error-on-warning): New switch: Add -Werror to the + compiler command line. Enabled by default. Disable via + --disable-error-on-warning. + * configure: Regenerate. + 2005-03-16 Alan Modra <amodra@bigpond.net.au> * ppc-dis.c (powerpc_dialect): Don't set PPC_OPCODE_ALTIVEC when diff --git a/opcodes/configure b/opcodes/configure index 75d946d410d..6f57f4a8128 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -858,6 +858,7 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --enable-targets alternative target configurations --enable-commonbfdlib build shared BFD/opcodes/libiberty library + --enable-error-on-warning treat compile warnings as errors --enable-build-warnings Enable build-time compiler warnings if gcc is used --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer @@ -3978,7 +3979,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 3981 "configure"' > conftest.$ac_ext + echo '#line 3982 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4242,6 +4243,26 @@ echo "$as_me: error: bad value ${enableval} for opcodes commonbfdlib option" >&2 esac fi; build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" + +# Check whether --enable-error-on-warning or --disable-error-on-warning was given. +if test "${enable_error_on_warning+set}" = set; then + enableval="$enable_error_on_warning" + case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-error-on-warning" >&5 +echo "$as_me: error: bad value ${enableval} for --enable-error-on-warning" >&2;} + { (exit 1); exit 1; }; } ;; + esac +fi; + +# Enable -Werror by default, suppressing it only for --disable-error-on-warning +# or --disable-build-warnings. +if test "${ERROR_ON_WARNING}" != no +then + build_warnings="$build_warnings -Werror" +fi + # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" diff --git a/opcodes/configure.in b/opcodes/configure.in index bbe5aa3ad1e..cdf5c51613e 100644 --- a/opcodes/configure.in +++ b/opcodes/configure.in @@ -45,6 +45,22 @@ AC_ARG_ENABLE(commonbfdlib, esac])dnl build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" + +AC_ARG_ENABLE(error-on-warning, + [ --enable-error-on-warning treat compile warnings as errors], + [case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;; + esac]) + +# Enable -Werror by default, suppressing it only for --disable-error-on-warning +# or --disable-build-warnings. +if test "${ERROR_ON_WARNING}" != no +then + build_warnings="$build_warnings -Werror" +fi + AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in |