From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org)
	by nuthatch.gentoo.org with esmtp (Exim 4.54)
	id 1FUHoI-0003in-NS
	for garchives@archives.gentoo.org; Fri, 14 Apr 2006 06:29:39 +0000
Received: from robin.gentoo.org (localhost [127.0.0.1])
	by robin.gentoo.org (8.13.6/8.13.5) with SMTP id k3E6TckG032594;
	Fri, 14 Apr 2006 06:29:38 GMT
Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30])
	by robin.gentoo.org (8.13.6/8.13.5) with ESMTP id k3E6QVLp018160
	for <gentoo-dev@lists.gentoo.org>; Fri, 14 Apr 2006 06:26:31 GMT
Received: from cp237988-a.mill1.nb.home.nl ([84.29.235.69] helo=localhost)
	by smtp.gentoo.org with esmtpa (Exim 4.54)
	id 1FUHlG-0001mH-Sd
	for gentoo-dev@lists.gentoo.org; Fri, 14 Apr 2006 06:26:31 +0000
Date: Fri, 14 Apr 2006 08:27:03 +0200
From: Harald van =?unknown-8bit?Q?D=C4=B3k?= <truedfx@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] automatically killing invalid CFLAGS/warning about bad CFLAGS
Message-ID: <20060414062703.GA1111@gentoo.org>
References: <443EAB73.6030804@gentoo.org> <443F076C.8030005@gentoo.org> <443F0DB4.2070203@gentoo.org>
Precedence: bulk
List-Post: <mailto:gentoo-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-dev+help@gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev+unsubscribe@gentoo.org>
List-Subscribe: <mailto:gentoo-dev+subscribe@gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@gentoo.org
Reply-to: gentoo-dev@lists.gentoo.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <443F0DB4.2070203@gentoo.org>
User-Agent: Mutt/1.5.11
X-Archives-Salt: d5d5d41f-45ca-4ca7-8212-1a97502c78a3
X-Archives-Hash: a3496f2effe5c223ce30eeff92508920

On Thu, Apr 13, 2006 at 10:49:24PM -0400, Patrick McLean wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Alec Warner wrote:
> > 
> > Except you need a way for them to turn it off, and you do not currently
> > provide one.  We can set default flags all we want, but I don't see
> > filtering 'bad' flags as necessarily our problem.  If you want to say:
> > 
> > "Hey we have had issues with people filing bogus bug reports with CFLAGS
> > that are completely inappropriate, so by default we check the sanity of
> > your CFLAGS, this is how you turn those checks off." then I'd be ok with it.
> >
> > Most of the Ricers won't read it, and maybe you can print a warning that
> > CFLAG checking is disabled.
> > 
> > However leaving it on all the time merely imposes penalties on the power
> > users who wish to use your profile.  Your profile is a tool that should
> > be useful to all classes of users.
> > 
> 
> The only flags that are actually removed are the _invalid_ flags. These are the
> flags that gcc does not accept, and will error out on. The "bad" flags, IE the
> ones that the developers consider to be broken, but that are accepted by gcc are
> not filtered, the profile simply prints a warning and pauses for 5 seconds to
> encourage users to read the warning, it does not automatically filter any flags
> that the compiler accepts.

The only flags that are actually removed are the flags that are invalid
_by themselves_. There are cases where flags are valid because of other
flags, such as anything following -X*.

Two other problems I see with the code:
CFLAGS=${CFLAGS//bad-flag} is in the ebuild quiz, if I recall correctly.
It's broken because it also removes valid flags that happen to contain
bad-flag as a substring.
Locale isn't forced to C, which means gcc may not spit out 'unrecognized
option' at all even for invalid flags.
-- 
gentoo-dev@gentoo.org mailing list