
Hi Team, I am facing this issue while compiling the tzdata latest version tzdb-2023c.I attached the log for your reference. Thanks, Naveen.

On 5/30/23 00:57, Naveen kumar via tz wrote:
I am facing this issue while compiling the tzdata latest version tzdb-2023c.I attached the log for your reference.
Thanks for reporting the problem. What compiler and compiler version are you using? For example, if you're using GCC, what is the output of the 'gcc --version' command? What options are you giving the compiler? Is the problem new to tzdb-2023c, or do you see it with earlier versions of tzdb? Does the problem go away if you compile with the -DPORT_TO_C89 compiler option? E.g., make CFLAGS='-DPORT_TO_C89' The PORT_TO_C89 flag is documented in the Makefile.

Hi Paul, 1. - Kernel - 2.6.31 - gcc - 4.9.4 - glibc - 2.19 2. please refer to the attached log file. 3. I am facing this issue in the latest version tzdb-2023c. 4. i used the -DPORT_TO_C89 option in CFLAGS also the same error occurred. I also attached the error log also. Thanks, Naveen. On Wed, May 31, 2023 at 3:48 AM Paul Eggert <eggert@cs.ucla.edu> wrote:
On 5/30/23 00:57, Naveen kumar via tz wrote:
I am facing this issue while compiling the tzdata latest version tzdb-2023c.I attached the log for your reference.
Thanks for reporting the problem.
What compiler and compiler version are you using? For example, if you're using GCC, what is the output of the 'gcc --version' command?
What options are you giving the compiler?
Is the problem new to tzdb-2023c, or do you see it with earlier versions of tzdb?
Does the problem go away if you compile with the -DPORT_TO_C89 compiler option? E.g.,
make CFLAGS='-DPORT_TO_C89'
The PORT_TO_C89 flag is documented in the Makefile.

Naveen kumar replied to Paul Eggert:
Is the problem new to tzdb-2023c, or do you see it with earlier versions of tzdb?
3. I am facing this issue in the latest version tzdb-2023c.
Although Naveen didn’t actually answer Paul’s question of whether the problem is new to 2023c, it seems reasonable to guess it is related to these changes implemented in 2023a, which Paul’s subsequent questions alluded to: | Briefly: | [...] | The code now defaults to C99 or later. | Fix use of C23 attributes. -- Doug Ewell, CC, ALB | Lakewood, CO, US | ewellic.org

On May 31, 2023, at 12:30 AM, Naveen kumar via tz <tz@iana.org> wrote:
• gcc - 4.9.4
...
i used the -DPORT_TO_C89 option in CFLAGS also the same error occurred. I also attached the error log also.
private.h does #if (__STDC_VERSION__ < 199901 && !defined restrict \ && (PORT_TO_C89 || defined _MSC_VER)) # define restrict /* empty */ #endif before it uses the new-in-c99 "restrict" keyword. 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. Did you add -DPORT_TO_C89 to the end of the "CFLAGS=" line in Makefile before running make? If not, in what fashion did you use the -DPORT_TO_C89 option in CFLAGS?

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.

Hi , I added the -std=gnu11 options also it's shows same error. On Thu, 1 Jun, 2023, 5:38 am Paul Eggert, <eggert@cs.ucla.edu> wrote:
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.

On Jun 1, 2023, at 1:12 AM, Naveen kumar <navinagaraj18@gmail.com> wrote:
I added the -std=gnu11 options also it's shows same error.
So you added it to the CFLAGS= line in the Makefile and it still complains about "restrict"? If so, what happens if you add "-std=gnu99" instead? Or you ran make CFLAGS="-std=gnu11" ... and it still complains about "restrict"? If so, what happens if you use "-std=gnu99" instead?

Hi Team, Now it's working fine with c11 standard. Thanks & Regards, Naveen. On Thu, 1 Jun, 2023, 2:25 pm Guy Harris, <gharris@sonic.net> wrote:
On Jun 1, 2023, at 1:12 AM, Naveen kumar <navinagaraj18@gmail.com> wrote:
I added the -std=gnu11 options also it's shows same error.
So you added it to the CFLAGS= line in the Makefile and it still complains about "restrict"? If so, what happens if you add "-std=gnu99" instead?
Or you ran
make CFLAGS="-std=gnu11" ...
and it still complains about "restrict"? If so, what happens if you use "-std=gnu99" instead?

CFLAGS="-Os -g -pipe" LDFLAGS="" CXXFLAGS="-Os -g -pipe" \ CFLAGS='-DPORT_TO_C89 ' \ make -j6 zic=zic cc=arm-linux-gnueabi-gcc ZDUMPDIR=/usr/sbin ZFLAGS="-b slim" make[1]: Entering directory '/home/tzdb-2023c'
That merely tries to set CFLAGS in the environment of 'make', which is ineffective as one can see from the failing command, which was:
arm-linux-gnueabi-gcc -DTZDIR='"/usr/share/zoneinfo"' -c -o asctime.o asctime.c
with no "-DPORT_TO_C89" in sight. I suggest that you instead give a CFLAGS=... argument to 'make', e.g., via this shell command: make -j6 zic=zic cc=arm-linux-gnueabi-gcc \ ZDUMPDIR=/usr/sbin ZFLAGS="-b slim" \ CFLAGS="-Os -g -pipe -DPORT_TO_C89" There's no need to set CXXFLAGS as tzcode doesn't use C++.
participants (4)
-
Doug Ewell
-
Guy Harris
-
Naveen kumar
-
Paul Eggert