From: Bruce Korb Date: Sat, 21 Jul 2001 04:08:29 +0000 (+0000) Subject: force unsigned char compares X-Git-Tag: prereleases/libstdc++-3.0.95~3143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90376ae2b447ac3607e4a76378b74766850478a6;p=thirdparty%2Fgcc.git force unsigned char compares From-SVN: r44219 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f6c91979ffb..e1c3ef53f6b0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-07-20 Bruce Korb + + * fixinc/fixincl.c(test_for_changes): force unsigned char comparisons + because getc() and char* may disagree on signedness. + 2001-07-20 Richard Henderson * doc/rtl.texi (REG_DEAD): Update for current semantics. diff --git a/gcc/fixinc/fixincl.c b/gcc/fixinc/fixincl.c index 08d94f7e34d6..23d390024fc0 100644 --- a/gcc/fixinc/fixincl.c +++ b/gcc/fixinc/fixincl.c @@ -1261,7 +1261,7 @@ test_for_changes (read_fd) { FILE *in_fp = fdopen (read_fd, "r"); FILE *out_fp = (FILE *) NULL; - char *pz_cmp = pz_curr_data; + unsigned char *pz_cmp = (unsigned char*)pz_curr_data; #ifdef DO_STATS fixed_ct++; @@ -1273,6 +1273,7 @@ test_for_changes (read_fd) ch = getc (in_fp); if (ch == EOF) break; + ch &= 0xFF; /* all bytes are 8 bits */ /* IF we are emitting the output THEN emit this character, too.