Re: Reasons not to like asprintf

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Reasons not to like asprintf
Date: 2013-10-22 19:51:15
Message-ID: 20131022195115.GG2706@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> ... BTW, another reason to choose identical APIs for frontend and backend
> versions of these functions is that it greatly eases use of them in shared
> frontend/backend code. As I notice somebody has *already done* in
> common/relpath.c. I'm not exactly sure how those psprintf calls are
> working at all in frontend builds. Maybe they aren't quite, and that has
> something to do with the failures on anole?

Seems plausible.

> In order to avoid having to clutter stuff like that with #ifdef FRONTENDs,
> I'm now thinking we should use exactly the same names for the frontend and
> backend versions, ie psprintf() and pvsprintf(). The main reason for
> considering a pg_ prefix for the frontend versions was to avoid cluttering
> application namespace; but it's already the case that we don't expect
> libpgcommon to be namespace clean.

To be honest, I had been assuming we'd use the same names. As for which
direction to go, I'd personally prefer psprintf but that's just my lazy
developer fingers talking.

Thanks,

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-10-22 20:26:03 Re: Failure while inserting parent tuple to B-tree is not fun
Previous Message Alvaro Herrera 2013-10-22 19:50:35 Re: Reasons not to like asprintf