protoize.c (safe_read, safe_write): Avoid the gcc extension of using arithmetic on...
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sat, 16 Oct 1999 15:32:00 +0000 (15:32 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sat, 16 Oct 1999 15:32:00 +0000 (15:32 +0000)
        * protoize.c (safe_read, safe_write): Avoid the gcc extension of
        using arithmetic on void pointers.

From-SVN: r30043

gcc/ChangeLog
gcc/protoize.c

index 0676b06d19a836cd306ce0bd9a2ce44c493c9af0..553d6b32368856e611d3729accb16ed02d9ed974 100644 (file)
@@ -1,3 +1,8 @@
+Sat Oct 16 11:29:14 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * protoize.c (safe_read, safe_write): Avoid the gcc extension of
+       using arithmetic on void pointers.
+
 Sat Oct 16 02:48:22 1999  Jeffrey A Law  (law@cygnus.com)
 
        * haifa-sched.c (compute_block_forward_dependencies): Only check
index 04aa7cfd5e982c98bc069ad4a9c231f66ba0e2ae..8b518512da2dca842f97546aeaa0d6e8e208f284 100644 (file)
@@ -617,7 +617,8 @@ safe_read (desc, ptr, len)
       }
     if (nchars == 0)
       break;
-    ptr += nchars;
+    /* Arithmetic on void pointers is a gcc extention.  */
+    ptr = (char *) ptr + nchars;
     left -= nchars;
   }
   return len - left;
@@ -646,7 +647,8 @@ safe_write (desc, ptr, len, out_fname)
                pname, shortpath (NULL, out_fname), xstrerror (errno_val));
        return;
       }
-    ptr += written;
+    /* Arithmetic on void pointers is a gcc extention.  */
+    ptr = (char *) ptr + written;
     len -= written;
   }
 }