[gnu.gcc.bug] Problem with unsigned char in GCC 1.28 on Sun

weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) (11/14/88)

The following program prints the right value (106) when compiled with
-O, but prints 0 when compiled without -O.  This is with GCC 1.28 on
Sun-2 and Sun-3 systems.

main ()
{
  foo("abcdefghijklm",13);
}

foo(addr,len)
unsigned char *addr;
int len;
{
  int i;
  i = *(addr+9);
  printf("%d\n",i);
}

weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) (11/15/88)

The bug I described in my previous message seems to have been fixed in
GCC 1.30 (which I can now run on my Sun-2, thanks RMS!), so please
ignore that message.