Re: compile warnings in CVS - Mailing list pgsql-hackers

From Tom Lane
Subject Re: compile warnings in CVS
Date
Msg-id 5359.1029615079@sss.pgh.pa.us
Whole thread Raw
In response to compile warnings in CVS  (Neil Conway <nconway@klamath.dyndns.org>)
Responses Re: compile warnings in CVS
Re: compile warnings in CVS
List pgsql-hackers
Neil Conway <nconway@klamath.dyndns.org> writes:
> pg_controldata.c: In function `main':
> pg_controldata.c:91: warning: `%c' yields only last 2 digits of year in some locales
> pg_controldata.c:93: warning: `%c' yields only last 2 digits of year in some locales

Yeah.  I was willing to ignore that while pg_controldata was in contrib,
but it's much more annoying when it's in the main tree.  Anyone know if
gcc has a --not-quite-so-nannyish warnings mode?

IMHO %c is a perfectly reasonable format choice --- the strftime man
page defines it as         %c        Locale's appropriate date and time representation.
While we could go over to some %Y-%M-etc-etc notation, that doesn't
strike me as a step forward.  pg_controldata's output should be
conveniently human-readable IMHO, and that means following local
conventions.

Another alternative ischar *fmt = "%c";...strftime(..., fmt, ...);

which I think will probably defeat gcc's check (haven't tried it
though).

Does anyone want to argue that %c is actually a bad choice?  I think
gcc's just being unreasonable here, but maybe I'm missing something
(and no, Y2K arguments won't change my mind).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: compile warnings in CVS
Next
From: Rod Taylor
Date:
Subject: Remove implicit unique index creation on SERIAL columns?