Gentoo Archives: gentoo-dev

From: "Harald van Dijk" <truedfx@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] automatically killing invalid CFLAGS/warning about bad CFLAGS
Date: Fri, 14 Apr 2006 19:20:27
Message-Id: 20060414191726.GA618@gentoo.org
In Reply to: Re: [gentoo-dev] automatically killing invalid CFLAGS/warning about bad CFLAGS by Patrick McLean
1 On Fri, Apr 14, 2006 at 01:47:41PM -0400, Patrick McLean wrote:
2 > -----BEGIN PGP SIGNED MESSAGE-----
3 > Hash: SHA1
4 >
5 > Harald van D?k wrote:
6 > > The only flags that are actually removed are the flags that are invalid
7 > > _by themselves_. There are cases where flags are valid because of other
8 > > flags, such as anything following -X*.
9 > >
10 > > Two other problems I see with the code:
11 > > CFLAGS=${CFLAGS//bad-flag} is in the ebuild quiz, if I recall correctly.
12 > > It's broken because it also removes valid flags that happen to contain
13 > > bad-flag as a substring.
14 > > Locale isn't forced to C, which means gcc may not spit out 'unrecognized
15 > > option' at all even for invalid flags.
16 >
17 > There is a new version at http://dev.gentoo.org/~chutzpah/profile.bashrc that
18 > should fix all these possible problems. Thanks for pointing them out, let me
19 > know if you see anything else.
20
21 For the locale stuff, you're not exporting LC_ALL, which means if LC_ALL
22 is unset, and LC_MESSAGES is set, gcc might still spit out French (for
23 example) error messages. Also, it can be made simpler: changing the
24 command to `LC_ALL=C ${myprog} ${@} -E - 2>&1` should do it. LC_ALL
25 overrides LANG, so that can be left alone, and adding it right in front
26 of the command makes sure it gets exported, but not in the current
27 shell, so there's no need to manually restore it.
28 --
29 gentoo-dev@g.o mailing list