From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6576 invoked by alias); 20 Dec 2010 10:19:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28540 Received: (qmail 10425 invoked from network); 20 Dec 2010 10:19:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Mon, 20 Dec 2010 10:07:50 +0000 From: Peter Stephenson To: Subject: Re: PATCH: Errors compiling on HP-UX with HP's compiler Message-ID: <20101220100750.79fd858a@pwslap01u.europe.root.pri> In-Reply-To: <20101220060037.GA14117@sverige> References: <20101220060037.GA14117@sverige> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Dec 2010 10:07:50.0332 (UTC) FILETIME=[C242C7C0:01CBA02D] X-Scanned-By: MailControl A_10_80_00 (www.mailcontrol.com) on 10.68.0.162 On Mon, 20 Dec 2010 06:00:37 +0000 Paul Ackersviller wrote: > 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. Thanks, we should really have been picked that up by now... Some older systems used char * in read() and write(), and in fact there's a definition in prototypes.h that's somewhat out of date to cope with that. I wouldn't be at all surprised if it didn't compile on any such system any more, but it might as well be left open. Given that write_loop() and read_loop() now always take char *, and a char * will be converted to a void * without any problem, I think I'll remove the outdated type definitions and do without the casts... Index: Src/init.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/init.c,v retrieving revision 1.116 diff -p -u -r1.116 init.c --- Src/init.c 15 Jul 2010 18:44:13 -0000 1.116 +++ Src/init.c 20 Dec 2010 10:02:04 -0000 @@ -1380,7 +1380,7 @@ VA_DCL pptbuf = unmetafy(promptexpand(lp ? *lp : NULL, 0, NULL, NULL, NULL), &pptlen); - write_loop(2, (WRITE_ARG_2_T)pptbuf, pptlen); + write_loop(2, pptbuf, pptlen); free(pptbuf); ret = shingetline(); Index: Src/input.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/input.c,v retrieving revision 1.20 diff -p -u -r1.20 input.c --- Src/input.c 25 Mar 2010 14:03:51 -0000 1.20 +++ Src/input.c 20 Dec 2010 10:02:04 -0000 @@ -260,7 +260,7 @@ inputline(void) int pptlen; pptbuf = unmetafy(promptexpand(ingetcpmptl ? *ingetcpmptl : NULL, 0, NULL, NULL, NULL), &pptlen); - write_loop(2, (WRITE_ARG_2_T)pptbuf, pptlen); + write_loop(2, pptbuf, pptlen); free(pptbuf); } ingetcline = shingetline(); Index: Src/prototypes.h =================================================================== RCS file: /cvsroot/zsh/zsh/Src/prototypes.h,v retrieving revision 1.4 diff -p -u -r1.4 prototypes.h --- Src/prototypes.h 13 Apr 2001 16:29:28 -0000 1.4 +++ Src/prototypes.h 20 Dec 2010 10:02:04 -0000 @@ -44,13 +44,6 @@ extern int tputs _((char *cp, int affcnt /* MISSING PROTOTYPES FOR VARIOUS OPERATING SYSTEMS */ -/* HP/UX 9 c89 */ -#if defined(__hpux) && defined(_XPG3) && !defined(_POSIX1_1988) -# define WRITE_ARG_2_T void * -#else -# define WRITE_ARG_2_T char * -#endif - #if defined(__hpux) && defined(_HPUX_SOURCE) && !defined(_XPG4_EXTENDED) # define SELECT_ARG_2_T int * #else Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.251 diff -p -u -r1.251 utils.c --- Src/utils.c 6 Dec 2010 19:34:33 -0000 1.251 +++ Src/utils.c 20 Dec 2010 10:02:04 -0000 @@ -2272,7 +2272,7 @@ checkrmall(char *s) /**/ 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; @@ -2298,7 +2298,7 @@ read_loop(int fd, void *buf, size_t len) /**/ 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; Index: Src/Zle/zle_main.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v retrieving revision 1.126 diff -p -u -r1.126 zle_main.c --- Src/Zle/zle_main.c 20 Sep 2010 09:27:46 -0000 1.126 +++ Src/Zle/zle_main.c 20 Dec 2010 10:02:04 -0000 @@ -1132,7 +1132,7 @@ zleread(char **lp, char **rp, int flags, pptbuf = unmetafy(promptexpand(lp ? *lp : NULL, 0, NULL, NULL, &pmpt_attr), &pptlen); - write_loop(2, (WRITE_ARG_2_T)pptbuf, pptlen); + write_loop(2, pptbuf, pptlen); free(pptbuf); return shingetline(); } -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom