[tz] Anyone else having snprintf issues with 2017c?
Brian.Inglis at SystematicSw.ab.ca
Tue Oct 24 03:58:57 UTC 2017
On 2017-10-23 20:14, Guy Harris wrote:
> On Oct 23, 2017, at 11:52 AM, Jon Skeet <skeet at pobox.com> 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
> The .travis.yml file says
> dist: trusty
> I'm assuming that's Ubuntu Trusty Tahr, which I would expect to have C
> compilers that support C99 and a libc that includes snprintf().
Release compiler from trusty-updates is:
$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
for baseline trusty it is 4.8.2, for Xenial it is 5.3.1, Yakkety 6.1.1, Zesty
6.3.0, same as Debian Stretch; Debian Sid is at 7.2.0.
> However, I'm not sure the compiler would *default* to C99; perhaps you need
> to compile with -std=c99 rather than, say, -ansi, which may default to C90
> rather than C99.
Default is -std=gnu90 - from "info gcc option std=" - c99/c11 support was
incomplete; "info gcc Standards" says compliance is issuing required diagnostics
with -std=c## -Wpedantic.
Actual standards support is always evolving, and dependent on the available
library i.e. GNU glibc, BSD libc, musl, Redhat/Sourceware newlib, uClibc-ng, etc.
Unless the code compiles with no warnings using -ansi -pedantic, and then builds
successfully, I'd compile with -std=gnu11 -Wall -Wextra for maximum flexibility.
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
More information about the tz