Re: printf format selection vs. reality

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: printf format selection vs. reality
Date: 2018-05-23 22:04:04
Message-ID: 12705.1527113044@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sigh, I'm an idiot. I forgot that USE_REPL_SNPRINTF doesn't just
replace snprintf, it replaces the entire *printf family; see
port.h lines 137ff. So actually we're OK as far as these %z and
argument-reordering concerns go. Maybe the comments in configure
could use a bit of work though.

There's maybe also an argument for reverting b929614f5, because
actually that code did do something useful, ie allow us to work on
platforms without %ll. But I'm inclined to leave that alone;
it's an extra configure test to detect a case that probably no longer
occurs in the wild. Moreover, since %ll and %z are both C99-isms,
and the former had considerable currency even before C99 (evidence:
gaur/pademelon) it's pretty hard to credit that a platform's *printf
would fail the %ll test yet pass the %z test. So I think we're
likely OK without it, even on dinosaur platforms.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-05-23 22:36:43 Re: printf format selection vs. reality
Previous Message Justin Pryzby 2018-05-23 21:35:13 documentation fixes for partition pruning, round two