zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Errors compiling on HP-UX with HP's compiler
@ 2010-12-20  6:00 Paul Ackersviller
  2010-12-20  8:57 ` Vincent Lefevre
  2010-12-20 10:07 ` Peter Stephenson
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Ackersviller @ 2010-12-20  6:00 UTC (permalink / raw)
  To: zsh-workers

I must be using gcc more often than not to have just run across this.
HP's compiler, I think rightly, refuses to do arithmetic on these two
void pointers.  Does gcc treat them as char * for that purpose?
The casts can obviously be done without.

Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.251
diff -u -r1.251 utils.c
--- Src/utils.c 6 Dec 2010 19:34:33 -0000       1.251
+++ Src/utils.c 20 Dec 2010 03:41:01 -0000
@@ -2272,12 +2272,12 @@

 /**/
 mod_export ssize_t
-read_loop(int fd, void *buf, size_t len)
+read_loop(int fd, char *buf, size_t len)
 {
     ssize_t got = len;

     while (1) {
-       ssize_t ret = read(fd, buf, len);
+       ssize_t ret = read(fd, (void *) buf, len);
        if (ret == len)
            break;
        if (ret <= 0) {
@@ -2298,12 +2298,12 @@

 /**/
 mod_export ssize_t
-write_loop(int fd, const void *buf, size_t len)
+write_loop(int fd, const char *buf, size_t len)
 {
     ssize_t wrote = len;

     while (1) {
-       ssize_t ret = write(fd, buf, len);
+       ssize_t ret = write(fd, (void *) buf, len);
        if (ret == len)
            break;
        if (ret < 0) {
@@ -2407,7 +2407,7 @@
        zbeep();
     }
     if (c >= 0)
-       write_loop(SHTTY, &c, 1);
+       write_loop(SHTTY, (char *) &c, 1);
     if (nl)
        write_loop(SHTTY, "\n", 1);


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-20 10:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-20  6:00 PATCH: Errors compiling on HP-UX with HP's compiler Paul Ackersviller
2010-12-20  8:57 ` Vincent Lefevre
2010-12-20 10:07 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).