This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Mainline bootstrap failure on hppa2.0w-hp-hpux11.00
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: ghazi at caip dot rutgers dot edu (Kaveh R. Ghazi)
- Cc: gcc-patches at gcc dot gnu dot org, roger at eyesopen dot com
- Date: Wed, 5 Feb 2003 11:40:08 -0500 (EST)
- Subject: Re: Mainline bootstrap failure on hppa2.0w-hp-hpux11.00
> IMHO, you should go with a fixincl hack to silence it. If only so
> that all the hpux users who enable warnings don't get this spurious
> one when they use ctype macros.
In principal, I am against fixincl hacks unless absolutely necessary.
Every time that you introduce a new hack, you increase the possibility
that GCC will need to be rebuilt and reinstalled after a system header
update.
Secondly, I am not convinced that gcc should be warning in this situation.
Gcc does not warn for this code
int
foo (unsigned int x)
{
return x ? x : (int) 1;
}
However, it does warn for this code
foo (int x)
{
return x ? (unsigned) 1 : x;
}
So, the behavior is asymmetric. As far as I know, it is guaranteed
that the representations for "1" are identical, signed and unsigned.
Thus, I don't think there is a need to warn in the second case.
The warning from the HP header involves an "&" but still gcc has all the
information it needs to determine that the unsigned expression evaluates
to value in the set of signed integers. As far as I can tell, identical
arithmetic types are not a requirement of the standard for the "?"
operator. So, I am of the opinion that this is a problem with gcc's
warnings.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)