Gentoo Archives: gentoo-dev

From: Joshua Nichols <nichoj@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 18:06:01
Message-Id: 443FE419.7000201@gentoo.org
In Reply to: Re: [gentoo-dev] automatically killing invalid CFLAGS/warning about bad CFLAGS by Patrick McLean
1 Patrick McLean wrote:
2 > Harald van D?k wrote:
3 > >> The only flags that are actually removed are the flags that are invalid
4 > >> _by themselves_. There are cases where flags are valid because of other
5 > >> flags, such as anything following -X*.
6 > >>
7 > >> Two other problems I see with the code:
8 > >> CFLAGS=${CFLAGS//bad-flag} is in the ebuild quiz, if I recall
9 > correctly.
10 > >> It's broken because it also removes valid flags that happen to contain
11 > >> bad-flag as a substring.
12 > >> Locale isn't forced to C, which means gcc may not spit out
13 > 'unrecognized
14 > >> option' at all even for invalid flags.
15 >
16 > There is a new version at
17 > http://dev.gentoo.org/~chutzpah/profile.bashrc that
18 > should fix all these possible problems. Thanks for pointing them out,
19 > let me
20 > know if you see anything else.
21 Around line 77, you have:
22 hasme ${flag} ${CFLAGS} ${CXXFLAGS} && trigger=1 && \
23 ewarn "Your C(XX)FLAGS contain(s) \"${flag}\" which can break
24 packages."
25
26 Might I suggest you change it to something like:
27
28 if hasme ${flag} ${CFLAGS} ${CXXFLAGS}; then
29 trigger=1
30 ewarn "Your C(XX)FLAGS contain(s) \"${flag}\" which can break
31 packages."
32 fi
33
34 While there's nothing wrong with the original way, my suggestion would
35 make it a bit more obvious that you're setting the 'trigger' flag.
36
37 Regards,
38
39 Josh
40 --
41 gentoo-dev@g.o mailing list

Replies