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

From Andres Freund
Subject Re: Add %z support to elog/ereport?
Date
Msg-id 20131111163353.GD2401@awork2.anarazel.de
Whole thread Raw
In response to Re: Add %z support to elog/ereport?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Add %z support to elog/ereport?  (Andres Freund <andres@2ndquadrant.com>)
Re: Add %z support to elog/ereport?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2013-11-11 11:18:22 -0500, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > I'd like to add support for the length modifier %z. Linux' manpages
> > describes it as:
> >  z      A  following  integer conversion corresponds to a size_t or ssize_t argument.
> 
> > Since gcc's printf format checks understand it, we can add support for
> > it similar to the way we added %m support.
> 
> I think you'll find that %m is a totally different animal, because it
> doesn't involve consuming an argument position.

I was thinking of just replacing '%z' by '%l', '%ll' or '%' as needed
and not expand it inplace. That should deal with keeping the argument
position and such.
But that won't easily work if somebody specifies flags like padding :/

> I'm less than sure that every version of gcc will recognize %z, either
> ...

It's been in recognized in 2.95 afaics, so I think we're good.

> and what about the translation infrastructure?

That I have no clue about yet.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Add %z support to elog/ereport?
Next
From: Heikki Linnakangas
Date:
Subject: Re: Fwd: Test of Algorithm || Indexing Scheme