Re: minor compiler warning on OpenBSD - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: minor compiler warning on OpenBSD
Date
Msg-id 20070711222646.GF5267@alvh.no-ip.org
Whole thread Raw
In response to Re: minor compiler warning on OpenBSD  (Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>)
Responses Re: minor compiler warning on OpenBSD  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Stefan Kaltenbrunner wrote:
> Tom Lane wrote:
> > Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:
> >> while looking at some other stuff I noticed that we have the following
> >> compiler warning on OpenBSD 4.0/amd64 with the OS supplied compiler:
> >> initdb.c:2187: warning: `%x' yields only last 2 digits of year in some
> >> locales
> > 
> > Yeah, mine complains about that too.  Peter's response was "get a newer
> > compiler" --- apparently the gcc folks thought better of this warning
> > after the Y2K panic subsided.
> 
> hmm ok - but at least on openbsd we will have to accept that warning for
>  a few years to go (4.1 shipped with 3.3.5 and it seems that the
> upcoming 4.2 is not getting an upgraded compiler either)

My local manpage for strftime says that we can get around this warning
by overloading it with something like

size_t
my_strftime(char *s, size_t max, const char *fmt,    const struct tm *tm)
{return strftime(s, max, fmt, tm);
}


-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Count(*) throws error
Next
From: Greg Smith
Date:
Subject: Re: doubt