From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 609 invoked from network); 24 Jun 2003 15:36:18 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 24 Jun 2003 15:36:18 -0000 Received: (qmail 26578 invoked by alias); 24 Jun 2003 15:36:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18624 Received: (qmail 26570 invoked from network); 24 Jun 2003 15:36:12 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 24 Jun 2003 15:36:12 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [212.125.75.4] by sunsite.dk (MessageWall 1.0.8) with SMTP; 24 Jun 2003 15:36:12 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-22.tower-1.messagelabs.com!1056468499!36091 X-StarScan-Version: 5.0.6; banners=.,-,- Received: (qmail 21924 invoked from network); 24 Jun 2003 15:28:19 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-22.tower-1.messagelabs.com with SMTP; 24 Jun 2003 15:28:19 -0000 Received: from gmcs3.local ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id h5OFSIxN005995; Tue, 24 Jun 2003 16:28:18 +0100 Received: from gmcs3.local (localhost [127.0.0.1]) by gmcs3.local (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h5OFT8T13716; Tue, 24 Jun 2003 17:29:08 +0200 cc: zsh-workers@sunsite.dk, Stephane CHAZELAS X-VirusChecked: Checked In-reply-to: <16120.21181.974421.168422@ultrahot.finland.sun.com> From: Oliver Kiddle References: <16120.21181.974421.168422@ultrahot.finland.sun.com> To: Tomi.Vainio@Sun.COM Subject: Re: 4.1.1 doesn't compile Date: Tue, 24 Jun 2003 17:29:08 +0200 Message-ID: <13714.1056468548@gmcs3.local> Tomi Vainio - Sun Finland wrote: > Minor problem compiling latest zsh. 64bit compilation fails but 32bit > still works. Thanks for reporting this. I can reproduce it. > ***64bit*** > cc -c -I. -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -DMODULE -xO4 -xarch=v9 -KPIC -o terminfo..o terminfo.c > "terminfo.c", line 110: warning: argument #3 is incompatible with prototype: > prototype: pointer to function(char) returning int : "/usr/include/term.h", line 1205 > argument : pointer to function(int) returning int This is only a warning but does anyone know if we could safely use putp() instead of tputs() to avoid it (prototype for tputs seems to be subtly different between Solaris and Linux)? > "terminfo.c", line 113: prototype mismatch: 2 args passed, 10 expected This is the error. The reason why it fails for 64-bit but not 32-bit probably has something to do with this section of term.h: #if defined(_XPG4_2) || defined(_LP64) || defined(__cplusplus) extern char *tparm(char *, long, long, long, long, long, long, long, long, long); #else /* this is wrong, but is needed for historical reasons */ extern char *tparm(); #endif As you can see, Solaris' tparm() prototype wants there to be 9 parameters (10 arguments). This is the same chunk of code that Stephane Chazelas was complaining about in 18544. Reading back over that, what Stephane says makes a lot of sense and the code is clearly badly broken. It only ever passes one parameter. If you look at the output of `echoti cup 5 10|od -t c', the second parameter is defaulting to something big. On the question of how to determine if parameters should be integer or string, it might work to just treat them all as strings. They are just converted back to strings for the escape sequence anyway. It'll need a bit of experimenting. For the moment, the following quick patch will allow compilation on Solaris to at least not fail. Oliver --- terminfo.c.bak 2003-06-24 15:17:22.333407000 +0000 +++ terminfo.c 2003-06-24 15:21:52.103550000 +0000 @@ -110,7 +110,7 @@ tputs(t, 1, putraw); else { num = (argv[1]) ? atoi(argv[1]) : atoi(*argv); - tputs(tparm(t, atoi(*argv)), num, putraw); + tputs(tparm(t, atoi(*argv), 0, 0, 0, 0, 0, 0, 0, 0), num, putraw); } return 0; ________________________________________________________________________ This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com ________________________________________________________________________