From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MEp2T-0003uB-Cg for qemu-devel@nongnu.org; Thu, 11 Jun 2009 14:30:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MEp2O-0003tn-U6 for qemu-devel@nongnu.org; Thu, 11 Jun 2009 14:30:12 -0400 Received: from [199.232.76.173] (port=59376 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEp2O-0003tj-Ni for qemu-devel@nongnu.org; Thu, 11 Jun 2009 14:30:08 -0400 Received: from qw-out-1920.google.com ([74.125.92.148]:35222) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MEp2O-0003iK-AW for qemu-devel@nongnu.org; Thu, 11 Jun 2009 14:30:08 -0400 Received: by qw-out-1920.google.com with SMTP id 4so908247qwk.4 for ; Thu, 11 Jun 2009 11:30:07 -0700 (PDT) Message-ID: <4A314D2D.2060505@codemonkey.ws> Date: Thu, 11 Jun 2009 13:30:05 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC] Enable Werrror by default References: <200906111335.10116.paul@codesourcery.com> <1244726086.7752.25.camel@blaa> In-Reply-To: <1244726086.7752.25.camel@blaa> Content-Type: multipart/mixed; boundary="------------000403010302000005060909" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark McLoughlin Cc: Paul Brook , qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------000403010302000005060909 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mark McLoughlin wrote: > On Thu, 2009-06-11 at 13:35 +0100, Paul Brook wrote: > > >> I'd like to enable Werror by default. I've been using --enable-werror locally >> for a while now, and it's been extremely useful in picking up dumb errors >> (like the recent stellaris_enet.c breakage). >> >> Any objections? >> >> You can of course configure with --disable-werror if you really want the force >> things to build. >> > > Based on experiences with other projects: > > 1) Release tarballs should not ship with -Werror on by default - e.g. > new gcc comes along with new warnings and the tarball build fails > with no benefit to anyone > > 2) Anyone submitting patches should build with -Werror and make sure > they don't introduce new warnings > > 3) People with newer gcc are likely to be tripped up by warnings > introduced by others with older gcc[1] > > 4) It's debatable whether builds from git should default to -Werror - > on the plus side it helps ensure (2) happens, on the minus side if > a warning does sneak in, it makes life a pain for everyone until a > fix gets applied > > IMHO, we should enable it by default for git builds. > How about the following? It currently only enables werror for Linux hosts and git builds. Regards, Anthony Liguori --------------000403010302000005060909 Content-Type: text/x-patch; name="enable-werror.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="enable-werror.patch" commit ba59b4615be2b9b989b425bad2499f47a6928d5c Author: Anthony Liguori Date: Thu Jun 11 13:28:25 2009 -0500 Enable -Werror by default for git builds on Linux hosts Additional hosts can be added to the white list as they are confirmed to build with --enable-werror. Signed-off-by: Anthony Liguori diff --git a/configure b/configure index 89e7f53..48c8949 100755 --- a/configure +++ b/configure @@ -356,11 +356,7 @@ else fi [ -f "$workdir/vl.c" ] || source_path_used="yes" -werror="no" -# generate compile errors on warnings for development builds -#if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then -#werror="yes"; -#fi +werror="" for opt do optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` @@ -657,6 +653,18 @@ if test ! -x "$(which cgcc 2>/dev/null)"; then sparse="no" fi +# Consult white-list to determine whether to enable werror +# by default. Only enable by default for git builds +if test -z "$werror" ; then + z_version=`cut -f3 -d. $source_path/VERSION` + if test "$z_version" = "50" -a \ + "$linux" = "yes" ; then + werror="yes" + else + werror="no" + fi +fi + # # Solaris specific configure tool chain decisions # --------------000403010302000005060909--