This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]