[tz] Anyone else having snprintf issues with 2017c?

Patrice Scattolin patrice.scattolin at oracle.com
Mon Oct 23 19:21:01 UTC 2017

at line 803, zdump.c has a static declaration of snprintf. That 
declaration is within an "#ifdef !HAVE_SNPRINTF", presumably because 
this function is usually included by standard system header.

The error seems to indicate that now both this local version and the 
standard system version are picked up but they don't have the same 
declaration (static vs. non static). My hunch is that "#ifdef 
!HAVE_SNPRINTF" should not have evaluated to true for that platform. In 
the old days I would have suspected an issue with autoconf but here you 
are on your own.

Presumably it's the value of __STDC_VERSION__ inside the declaration of 
HAVE_SNPRINTF that's causing the problem in one environment but not the 
other. See at line 25:

# define HAVE_SNPRINTF (199901 <= __STDC_VERSION__)

I don't have an environment to test this though.  You might want to 
print __STDC_VERSION__ in both environment and see if you see a 
different value.

On 23/10/2017 2:52 PM, Jon Skeet wrote:
> The tzvalidate 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_nodatime_tzvalidate&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=rrUIZtLoHd-EZfVSe74qJIkRkrAVpmdxP365whX8xnI&m=FcfilsJr8smS5wUtPzyNxZPSlJhVDNeuFWgWlz06nlQ&s=0jMxq_R9hbV0HLxlu3TX-ZJ4aSW_Ph_ZYJI7ytPbJno&e=> 
> travis build is failing, with both clang and gcc, with this error:
> zdump.c:803:1: error: static declaration of ‘snprintf’ follows 
> non-static declaration
>  snprintf(char *s, size_t size, char const *format, ...)
>  ^
> make: *** [zdump.o] Error 1
> It's building fine for me locally, so I'm not quite sure what's wrong. 
> We're currently building on trusty - I may try another distro...
> The snprintf changes were introduced on June 13th 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_eggert_tz_commit_399180580f65bcad63cf996997068366cadaf530-23diff-2D75ca360cb0a2f0bee95d8fe83fc60ae7&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=rrUIZtLoHd-EZfVSe74qJIkRkrAVpmdxP365whX8xnI&m=FcfilsJr8smS5wUtPzyNxZPSlJhVDNeuFWgWlz06nlQ&s=P_PyjemTWWDtlH1iHri_KXEp4drFSFwEr-9DU6PHaAU&e=>. 
> It's been too long since I've done a lot of C to easily work out 
> what's going on. I'll investigate further myself tomorrow, but I 
> thought I'd just see if anyone else had seen this before then.
> Jon


Oracle Email Signature Logo
Patrice Scattolin | Software Development Manager | 514.905.8744
Oracle Cloud
600 Blvd de Maisonneuve West
Suite 1900
Montreal, Quebec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20171023/fba2ddc5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oracle_sig_logo.gif
Type: image/gif
Size: 658 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20171023/fba2ddc5/attachment.gif>

More information about the tz mailing list