force unsigned char compares
authorkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Jul 2001 04:08:29 +0000 (04:08 +0000)
committerkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Jul 2001 04:08:29 +0000 (04:08 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44219 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fixinc/fixincl.c

index 4f6c919..e1c3ef5 100644 (file)
@@ -1,3 +1,8 @@
+2001-07-20  Bruce Korb  <bkorb@gnu.org>
+
+       * fixinc/fixincl.c(test_for_changes): force unsigned char comparisons
+       because getc() and char* may disagree on signedness.
+
 2001-07-20  Richard Henderson  <rth@redhat.com>
 
        * doc/rtl.texi (REG_DEAD): Update for current semantics.
index 08d94f7..23d3900 100644 (file)
@@ -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.