Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 4.1.1 doesn't compile



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
________________________________________________________________________



Messages sorted by: Reverse Date, Date, Thread, Author