[tz] FreeBSD and USG_COMPAT

Andras Farkas deepbluemistake at gmail.com
Sat Nov 23 08:50:22 UTC 2019


FreeBSD doesn't support the int daylight or long timezone in time.h
itself.  tzcode supports them on OSes which already support them, like
OpenBSD.
I'm trying to figure out if it should be possible to compile tzcode to
support daylight and timezone even on OSes which don't support them.

I've saved the output of make (both stdout and stderr) when CFLAGS is
set to -DUSG_COMPAT=1 alone into usgcompat.txt
I've saved the output of make (both stdout and stderr) when CFLAGS is
set to '-DUSG_COMPAT=1 -DHAVE_POSIX_DECLS=0' into both.txt

What I'm seeing is that the OS's time.h is being included, under both
configurations.

This topic originated in this thread:
http://mm.icann.org/pipermail/tz/2019-November/028596.html
http://mm.icann.org/pipermail/tz/2019-November/thread.html
-------------- next part --------------
cc -DTZDIR='"/usr/share/zoneinfo"'  -DUSG_COMPAT=1 -c localtime.c -o localtime.o
localtime.c:277:14: error: non-object type 'char *(int, int)' is not assignable
    timezone = - ttisp->tt_utoff;
    ~~~~~~~~ ^
localtime.c:295:2: error: use of undeclared identifier 'daylight'
        daylight = 0;
        ^
localtime.c:296:11: error: non-object type 'char *(int, int)' is not assignable
        timezone = 0;
        ~~~~~~~~ ^
localtime.c:318:4: error: use of undeclared identifier 'daylight'
                        daylight = 1;
                        ^
4 errors generated.
*** Error code 1

Stop.
make: stopped in /usr/home/dogg/min/mod/tzdb-2019c
-------------- next part --------------
cc -DTZDIR='"/usr/share/zoneinfo"'  -DUSG_COMPAT=1 -DHAVE_POSIX_DECLS=0 -c zic.c -o zic.o
In file included from zic.c:9:
./private.h:520:13: error: redefinition of 'timezone' as different kind of symbol
extern long timezone;
            ^
/usr/include/time.h:197:7: note: previous definition is here
char *timezone(int, int);       /* XXX XSI conflict */
      ^
1 error generated.
*** Error code 1

Stop.
make: stopped in /usr/home/dogg/min/mod/tzdb-2019c


More information about the tz mailing list