Patrick McLean wrote:
> Harald van D?k wrote:
> >> 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.
>
> There is a new version at
> http://dev.gentoo.org/~chutzpah/profile.bashrc that
> should fix all these possible problems. Thanks for pointing them out,
> let me
> know if you see anything else.
Around line 77, you have:
hasme ${flag} ${CFLAGS} ${CXXFLAGS} && trigger=1 && \
ewarn "Your C(XX)FLAGS contain(s) \"${flag}\" which can break
packages."
Might I suggest you change it to something like:
if hasme ${flag} ${CFLAGS} ${CXXFLAGS}; then
trigger=1
ewarn "Your C(XX)FLAGS contain(s) \"${flag}\" which can break
packages."
fi
While there's nothing wrong with the original way, my suggestion would
make it a bit more obvious that you're setting the 'trigger' flag.
Regards,
Josh
--
[email protected] mailing list