[tz] Tzdb build issue

Paul Eggert eggert at cs.ucla.edu
Thu Jun 1 00:08:54 UTC 2023


On 2023-05-31 13:14, Guy Harris via tz wrote:
> I was able to build on Ubuntu 14.10 with GCC 4.9.1 by adding -DPORT_TO_C89 to the end of the "CFLAGS=" line in Makefile before running make; it didn't build unless I did that, as GCC 4.9.1 didn't recognize "restrict" as a keyword.

<https://gcc.gnu.org/c99status.html> says the 'restrict' keyword is 
supported by GCC 2.95 (1999) and later. GCC 4 and earlier, though, need 
an option like '-std=gnu11' to enable 'restrict', as these GCC versions 
default to C89 and 'restrict' is incompatible with C89.

Come to think of it, it's probably better to use -std=gnu11 than 
-DPORT_TO_C89 on Naveen's platform. Something like this, say:

   make -j6 zic=zic cc=arm-linux-gnueabi-gcc \
     ZDUMPDIR=/usr/sbin ZFLAGS="-b slim" \
     CFLAGS="-std=gnu11 -Os -g -pipe"

I installed the attached commentary patch into TZDB, to try to help 
others in Naveen's shoes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Prefer-std-gnu11-to-DPORT_TO_C89.patch
Type: text/x-patch
Size: 1053 bytes
Desc: not available
URL: <https://mm.icann.org/pipermail/tz/attachments/20230531/ff6c2bcf/0001-Prefer-std-gnu11-to-DPORT_TO_C89.patch>


More information about the tz mailing list