strftime's %c warning?

Ivan Voras ivoras at freebsd.org
Thu Oct 9 07:17:07 UTC 2008


2008/10/9 Sean C. Farley <scf at freebsd.org>:
> On Wed, 8 Oct 2008, Ivan Voras wrote:
>

>> str.c: In function 'ltime':
>> str.c:141: warning: '%c' yields only last 2 digits of year in some
>> locales on non-BSD systems
>> *** Error code 1
>>
>> Since the code I'm developing is definitely BSD-only (patch to pkg_*
>> infrastructure), should I:
>>
>> a) stop using locale-based %c and choose my own date/time format
>> b) remove WFORMAT from the Makefile?
>>
>> The same warning/error is generated by %x and %X, and %+ described in
>> the strftime man page isn't recognized.
>
> You are hitting a gcc builtin.  Have you tried adding
> -fno-builtin-strftime?

The code im working on is part of FreeBSD and uses FreeBSD's
infrastructure for building. I can avoid the warning by defining
WFORMAT to be 0 but I don't know how to add -fno-builtin-strftime
except directly into CFLAGS.

I don't think the original author (John Hubbard) is around anymore so
the question is - should I just remove WFPORMAT from this Makefile?


More information about the freebsd-hackers mailing list