From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29262 invoked by alias); 8 Jan 2006 17:59:33 -0000 Received: (qmail 29252 invoked by uid 22791); 8 Jan 2006 17:59:32 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 08 Jan 2006 17:59:27 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k08HxOqE002262 for ; Sun, 8 Jan 2006 18:59:24 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id k08HxOZb021908 for ; Sun, 8 Jan 2006 18:59:24 +0100 (CET) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id k08HxOxP007121; Sun, 8 Jan 2006 18:59:24 +0100 (CET) Date: Sun, 08 Jan 2006 17:59:00 -0000 Message-Id: <200601081759.k08HxOxP007121@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: gdb-patches@sourceware.org Subject: [RFA] Turn on -Werror by default Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00085.txt.bz2 A while ago, we basically agreed that this would be a good thing to do after the release. I tried to steal the code form BFD, but that didn't really fit in very well in our configure.ac. Anyway, this adds --enable-werror, defaulting to "yes", so to turn it off you'll probably want to use --disable-werror. This is similar to what BFD does, so you can easily disable -Werror for the whole tree. To disable -Werror for GDB only, you can use --enable-gdb-build-warnings=,-Wno-error. ok? Mark Index: configure.ac =================================================================== RCS file: /cvs/src/src/gdb/configure.ac,v retrieving revision 1.25 diff -u -p -r1.25 configure.ac --- configure.ac 17 Dec 2005 22:33:59 -0000 1.25 +++ configure.ac 8 Jan 2006 17:54:43 -0000 @@ -1109,6 +1109,24 @@ AC_ARG_WITH(sysroot, AC_SUBST(TARGET_SYSTEM_ROOT) AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) +AC_ARG_ENABLE(werror, + [ --enable-werror 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-werror) ;; + esac]) + +# 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 + # NOTE: Don't add -Wall or -Wunused, they both include # -Wunused-parameter which reports bogus warnings. # NOTE: If you add to this list, remember to update @@ -1164,7 +1182,6 @@ if test x"$silent" != x"yes" && test x"$ echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1 fi])dnl WARN_CFLAGS="" -WERROR_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes then AC_MSG_CHECKING(compiler warning flags)