Re: compile warnings in CVS

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: compile warnings in CVS
Date: 2002-08-18 00:06:18
Message-ID: 200208180006.g7I06IX14006@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Yes, very nanny-ish. Not sure how to turn it off.

---------------------------------------------------------------------------

Tom Lane wrote:
> Neil Conway <nconway(at)klamath(dot)dyndns(dot)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 is
> char *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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2002-08-18 00:42:53 cvs-tip broken
Previous Message Bruce Momjian 2002-08-18 00:05:49 Re: compile warnings in CVS