Torsten is not on the time zone mailing list; direct replies appropriately. --ado
-----Original Message----- From: Torsten Duwe [SMTP:duwe@caldera.de] Sent: Tuesday, July 25, 2000 8:35 AM To: tz@elsie.nci.nih.gov Cc: duwe@caldera.de Subject: tzcode standard C patch
Dear Mr. Olson (hope "tz" is a synonym, not a list :-) ,
attached you find the patch we at Caldera are using for quite a while now to compile the tzcode under Linux, namely with the GNU C library, version 2 and up. I strongly believe the old code compiles on other, "tradidional" Unix-like systems (if it does so at all without changes) because of their excessive backward compatibility, that the GNU C library intentionally has not. My manuals (GNU C library and NetBSD C Library) state that strerror/perror/<errno.h> comply to
ANSI X3.159-1989 (``ANSI C'') BSD 4.3, POSIX, X/OPEN .
I have carefully made the changes only to the "#ifdef unix" case, but I think it is applicable in general.
Thank you for your attention,
Torsten Duwe
--- zic.c~ Thu May 28 15:56:07 1998 +++ zic.c Mon Oct 12 17:04:02 1998 @@ -9,6 +9,7 @@ #include "tzfile.h" #ifdef unix #include "sys/stat.h" /* for umask manifest constants */ +#include <errno.h> #endif /* defined unix */
/* @@ -377,7 +378,9 @@ strerror(errnum) int errnum; { +#ifndef unix extern char * sys_errlist[]; +#endif extern int sys_nerr;
return (errnum > 0 && errnum <= sys_nerr) ?
From: Torsten Duwe [SMTP:duwe@caldera.de] Sent: Tuesday, July 25, 2000 8:35 AM
attached you find the patch we at Caldera are using for quite a while now to compile the tzcode under Linux, namely with the GNU C library, version 2 and up.
Thanks for reporting this. You shouldn't need that patch; all you should need to do is to compile with -DHAVE_STRERROR=1. That being said, I think HAVE_STRERROR should default to 1 these days; strerror has been in the C standard for more than a decade and I no longer have access to any hosts that lack strerror. Here's a proposed patch. 2000-07-25 Paul Eggert <eggert@twinsun.com> * Makefile, private.h: HAVE_STRERROR now defaults to 1, since strerror is now ubiquitous. =================================================================== RCS file: RCS/Makefile,v retrieving revision 2000.1.1.0 retrieving revision 2000.1.1.1 diff -pu -r2000.1.1.0 -r2000.1.1.1 --- Makefile 2000/04/19 05:01:31 2000.1.1.0 +++ Makefile 2000/07/26 04:39:14 2000.1.1.1 @@ -95,7 +95,7 @@ LDLIBS= # -DHAVE_SETTIMEOFDAY=1 if settimeofday has just 1 arg (SVR4) # -DHAVE_SETTIMEOFDAY=2 if settimeofday uses 2nd arg (4.3BSD) # -DHAVE_SETTIMEOFDAY=3 if settimeofday ignores 2nd arg (4.4BSD) -# -DHAVE_STRERROR=1 if `strerror' works +# -DHAVE_STRERROR=0 if your system lacks the strerror function # -DHAVE_SYMLINK=0 if your system lacks the symlink function # -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h" # -DLOCALE_HOME=\"path\" if locales are in "path", not "/usr/lib/locale" =================================================================== RCS file: RCS/private.h,v retrieving revision 1999.5.1.0 retrieving revision 1999.5.1.1 diff -pu -r1999.5.1.0 -r1999.5.1.1 --- private.h 2000/04/19 05:01:31 1999.5.1.0 +++ private.h 2000/07/26 04:39:14 1999.5.1.1 @@ -47,7 +47,7 @@ static char privatehid[] = "@(#)private. #endif /* !defined HAVE_SETTIMEOFDAY */ #ifndef HAVE_STRERROR -#define HAVE_STRERROR 0 +#define HAVE_STRERROR 1 #endif /* !defined HAVE_STRERROR */ #ifndef HAVE_SYMLINK
[So tz is a mailing list -- I see :-] Paul> Thanks for reporting this. You shouldn't need that patch; all you Paul> should need to do is to compile with -DHAVE_STRERROR=1. That being Paul> said, I think HAVE_STRERROR should default to 1 these days; Paul> strerror has been in the C standard for more than a decade and I no Paul> longer have access to any hosts that lack strerror. Paul> Here's a proposed patch. [...] Ah, yes -- my patch was too short-sighted, trying to cure the symptom only. And, ado: the sys_errlist[] declaration has a bunch of const's scattered all over. I think " extern const char * const sys_errlist[]; " is correct; that's what made the compiler choke in the first place. I think one could even put another const in between "char" and "*" ... ;-) Thanks for solving it "The Right Way[tm]" Torsten
participants (3)
-
Olson, Arthur David (NCI) -
Paul Eggert -
Torsten Duwe