bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strftime.c doesn't compile on hppa1.1-hp-hpux10.20


From: John David Anglin
Subject: strftime.c doesn't compile on hppa1.1-hp-hpux10.20
Date: Thu, 12 Aug 2004 14:03:10 -0400 (EDT)

Configuration Information [Automatically generated, do not change]:
Machine: hppa1.1
OS: hpux10.20
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='hppa1.1' 
-DCONF_OSTYPE='hpux10.20' -DCONF_MACHTYPE='hppa1.1-hp-hpux10.20' 
-DCONF_VENDOR='hp' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H -DHPUX  -I.  -I.. -I../include -I../lib  
-I/usr/local/include -O2
uname output: HP-UX hiauly1 B.10.20 E 9000/735 2007004454 8-user license
Machine Type: hppa1.1-hp-hpux10.20

Bash Version: 3.0
Patch Level: 0
Release Status: release

Description:
        Build error:

        gcc -c  -I. -I../.. -I../../.. -I../../../lib -I../../../include 
-I../../../lib/sh  -DHAVE_CONFIG_H -DSHELL -DHPUX  -O2 -I/usr/local/include  
../../../lib/sh/strftime.c
        ../../../lib/sh/strftime.c:101: error: conflicting types for 'timezone'
        /usr/include/sys/time.h:385: error: previous declaration of 'timezone' 
was here
        ../../../lib/sh/strftime.c:101: error: conflicting types for 'timezone'
        /usr/include/sys/time.h:385: error: previous declaration of 'timezone' 
was here
        ../../../lib/sh/strftime.c: In function `strftime':
        ../../../lib/sh/strftime.c:185: warning: assignment makes pointer from 
integer without a cast
        make[1]: *** [strftime.o] Error 1


Repeat-By:
        Rebuild on hpux.

Fix:
        
HP-UX 10 and 11 don't have altzone.  I hacked strftime.c to work around
this problem.

I should note that this isn't a complete fix for strftime.  I noticed
the `zone' is used before it is initialized by gettimeofday.  Actually,
using gettimeofday is an alternate solution for HP-UX, but it doesn't
have the timezone function.

--- strftime.c.orig     Wed Mar  3 22:13:23 2004
+++ strftime.c  Thu Aug 12 13:38:30 2004
@@ -97,6 +97,8 @@ extern char *tzname[2];
 extern int daylight;
 #if defined(SOLARIS) || defined(mips) || defined (M_UNIX)
 extern long int timezone, altzone;
+#elif defined(HPUX)
+extern long int timezone;
 #else
 extern int timezone, altzone;
 #endif
@@ -480,7 +482,11 @@ strftime(char *s, size_t maxsize, const 
                         * Systems with tzname[] probably have timezone as
                         * secs west of GMT.  Convert to mins east of GMT.
                         */
+#if defined(HPUX)
+                       off = -timezone / 60;
+#else
                        off = -(daylight ? timezone : altzone) / 60;
+#endif
 #else /* !HAVE_TZNAME */
                        off = -zone.tz_minuteswest;
 #endif /* !HAVE_TZNAME */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]