Re: Reasons not to like asprintf

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Reasons not to like asprintf
Date: 2013-10-24 18:26:55
Message-ID: 22929.1382639215@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> On 10/22/13, 3:40 PM, Tom Lane wrote:
>> 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.

> While this is attractive, the same logic would suggest that we rename
> pg_malloc() to palloc(), and that sounds wrong. The frontend and
> backend functions do have different freeing semantics.

We already crossed that bridge, though, by defining "palloc" in frontend
environments to mean pg_malloc. I'm doubtful that insisting on different
names is going to result in anything except #ifdef clutter.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-10-24 18:35:42 Re: Deprecations in authentication
Previous Message Peter Eisentraut 2013-10-24 18:18:02 Re: Reasons not to like asprintf