Re: Add %z support to elog/ereport? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add %z support to elog/ereport?
Date
Msg-id 26414.1390362149@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add %z support to elog/ereport?  (Florian Pflug <fgp@phlo.org>)
List pgsql-hackers
Florian Pflug <fgp@phlo.org> writes:
> On Jan21, 2014, at 18:56 , Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <robertmhaas@gmail.com> writes:
>>> it wouldn't play nice with GCC's desire to check format strings.

>> That last is a deal-breaker.  It's not just whether "gcc desires" to check
>> this --- we *need* that checking, because people get it wrong without it.

> There's an attribute that enables this check for arbitrary functions AFAIR.

Yeah, we use it (to enable checking for ereport et al).  The issue is that
the semantics of the format-string are pretty much hard-wired into gcc;
eg it knows that "%ld" should match an argument of type "long int".

IIRC it does know a couple of different styles corresponding to popular
libc implementations ... but it is not going to support some random
semantics that we dream up.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [bug fix] pg_ctl always uses the same event source
Next
From: Rajeev rastogi
Date:
Subject: Re: Patch: Show process IDs of processes holding a lock; show relation and tuple infos of a lock to acquire