Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!GANG-OF-FOUR.STANFORD.EDU!weening From: weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) Newsgroups: gnu.gcc.bug Subject: Problem with unsigned char in GCC 1.28 on Sun Message-ID: <8811132134.AA01547@Gang-of-Four.Stanford.EDU> Date: 13 Nov 88 21:34:44 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 17 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); }