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:

#ifndef HAVE_SNPRINTF
# define HAVE_SNPRINTF (199901 <= __STDC_VERSION__)
#endif

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 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. 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