This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch for compare1.c test failure
- To: Zack Weinberg <zack at bitmover dot com>
- Subject: Re: patch for compare1.c test failure
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 25 Oct 1999 22:50:38 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <199910260108.SAA20572@zack.bitmover.com>you write:
>
> This patch fixes the compare1.c test failure, which is a spurious
> warning (comparison between signed and unsigned) for code like
>
> enum machine_mode mode = DImode;
>
> return mode == (target_flags ? DImode : SImode);
>
> The approach taken has, I hope, minimal effects on the rest of the
> compiler. Another option would be to make enums with all nonnegative
> values signed when they will fit in signed int. This would be closer
> to the way numeric integer constants work, but would affect stuff all
> over the place.
Presumably this would still warn for
return mode == (target_flags & ? DImode : -1);
Or something like that, which I believe we determined was ugly, but allowed by
ISO C earlier this year.
Also note that a similar change would probably be necessary for cp/typeck.c
since it has nearly identical code.
Assuming that we still get the warning in the case noted above and you
update cp/typeck.c then you can install the patch.
Thanks,
jeff