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]

Re: patch for compare1.c test failure



  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



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