From: Paul Ackersviller <pda@sdf.lonestar.org>
To: zsh-workers@zsh.org
Subject: PATCH: Errors compiling on HP-UX with HP's compiler
Date: Mon, 20 Dec 2010 06:00:37 +0000 [thread overview]
Message-ID: <20101220060037.GA14117@sverige> (raw)
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);
next reply other threads:[~2010-12-20 6:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-20 6:00 Paul Ackersviller [this message]
2010-12-20 8:57 ` Vincent Lefevre
2010-12-20 10:07 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101220060037.GA14117@sverige \
--to=pda@sdf.lonestar.org \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).