Re: get_progname() should not be const char *?

From: Phil Sorber <phil(at)omniti(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: get_progname() should not be const char *?
Date: 2013-02-05 05:18:05
Message-ID: CADAkt-gGZTneCzbrnt9+umAfvDFtBGrNgnM8BicJOfMrE9EUVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 4, 2013 at 10:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Phil Sorber <phil(at)omniti(dot)com> writes:
>> get_progname() returns a strdup()'d value. Shouldn't it then be simply
>> char * and not const char *? Otherwise free() complains loudly without
>> a cast.
>
> I don't believe that callers should be trying to free() the result.
> Whether it's been strdup'd or not is not any of their business.

Is that just because of the nature of this specific function?

>
> regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-02-05 06:50:26 Re: proposal: ANSI SQL 2011 syntax for named parameters
Previous Message Tom Lane 2013-02-05 04:14:51 Re: pgsql: Stamp 9.1.8.