diff mbox

Enable by default -Werror just for bootstrap-debug.mk.

Message ID bcd2a768-9f41-f5a6-62ac-c18326e847ea@suse.cz
State New
Headers show

Commit Message

Martin Liška May 19, 2017, 12:56 p.m. UTC
On 05/19/2017 01:24 PM, Richard Biener wrote:
> On Wed, May 17, 2017 at 10:45 AM, Martin Liška <mliska@suse.cz> wrote:
>> Hi.
>>
>> As discussed on IRC some time ago, there are configurations that produce -Werror=maybe-uninitialized
>> and other warnings that break bootstrap. So that, the patch makes -Werror just for default (boostrap-debug)
>> configuration.
>>
>> Ready for trunk?
> 
> Hmm, this enables werror on release branches.  I think we also want to
> enable Werror for
> --without-build-config (or =yes and =no), thus regular bootstrap
> without bootstrap-debug.

Ok, fixed in attached patch v2.

Martin

> 
> Richard.
> 
>> Martin

Comments

Richard Biener May 19, 2017, 1:18 p.m. UTC | #1
On Fri, May 19, 2017 at 2:56 PM, Martin Liška <mliska@suse.cz> wrote:
> On 05/19/2017 01:24 PM, Richard Biener wrote:
>> On Wed, May 17, 2017 at 10:45 AM, Martin Liška <mliska@suse.cz> wrote:
>>> Hi.
>>>
>>> As discussed on IRC some time ago, there are configurations that produce -Werror=maybe-uninitialized
>>> and other warnings that break bootstrap. So that, the patch makes -Werror just for default (boostrap-debug)
>>> configuration.
>>>
>>> Ready for trunk?
>>
>> Hmm, this enables werror on release branches.  I think we also want to
>> enable Werror for
>> --without-build-config (or =yes and =no), thus regular bootstrap
>> without bootstrap-debug.
>
> Ok, fixed in attached patch v2.

Looks good to me.

Thanks,
Richard.

> Martin
>
>>
>> Richard.
>>
>>> Martin
>
diff mbox

Patch

From d7ad1fbd517f0f61be6c2e1d2770d44a37e90c4c Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 19 May 2017 14:54:19 +0200
Subject: [PATCH] Enable by default -Werror just for bootstrap-debug.mk and
 default build.

ChangeLog:

2017-05-19  Martin Liska  <mliska@suse.cz>

	* configure.ac: Add --enable-werror-always just for
	bootstrap-debug (or none build config) and do not add it
	when we are on a release branch.
	* configure: Regenerated.
---
 configure    | 16 ++++++++++------
 configure.ac | 17 +++++++++++------
 2 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index 32a38633ad8..2c2fe644cfa 100755
--- a/configure
+++ b/configure
@@ -14587,12 +14587,6 @@  fi
 # Check whether --enable-werror was given.
 if test "${enable_werror+set}" = set; then :
   enableval=$enable_werror;
-else
-  if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
-  enable_werror=yes
-else
-  enable_werror=no
-fi
 fi
 
 case ${enable_werror} in
@@ -14600,6 +14594,16 @@  case ${enable_werror} in
   *) stage2_werror_flag="" ;;
 esac
 
+if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
+  case $BUILD_CONFIG in
+  bootstrap-debug)
+      stage2_werror_flag="--enable-werror-always" ;;
+  "")
+      stage2_werror_flag="--enable-werror-always" ;;
+  esac
+fi
+
+
 
 # Enable --enable-host-shared.
 # Check whether --enable-host-shared was given.
diff --git a/configure.ac b/configure.ac
index 12377499295..865dd543fa3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3461,16 +3461,21 @@  AC_SUBST(stage1_checking)
 # Enable -Werror in bootstrap stage2 and later.
 AC_ARG_ENABLE(werror,
 [AS_HELP_STRING([--enable-werror],
-		[enable -Werror in bootstrap stage2 and later])], [],
-[if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
-  enable_werror=yes
-else
-  enable_werror=no
-fi])
+		[enable -Werror in bootstrap stage2 and later])], [], [])
 case ${enable_werror} in
   yes) stage2_werror_flag="--enable-werror-always" ;;
   *) stage2_werror_flag="" ;;
 esac
+
+if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
+  case $BUILD_CONFIG in
+  bootstrap-debug)
+      stage2_werror_flag="--enable-werror-always" ;;
+  "")
+      stage2_werror_flag="--enable-werror-always" ;;
+  esac
+fi
+
 AC_SUBST(stage2_werror_flag)
 
 # Enable --enable-host-shared.
-- 
2.12.2