Re: Add some const decorations to prototypes

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some const decorations to prototypes
Date: 2017-11-03 17:37:39
Message-ID: 1ef5f6af-c4d8-c8ab-aeb8-584fa397c041@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/31/17 10:56, Tom Lane wrote:
>> Some functions have a strtol()-like behavior
>> where they take in a const char * and return a pointer into that as
>> another argument. In those cases, I added a cast or two.
> ... but I'm not sure that it's an improvement in cases where you have to
> cast away the const somewhere else. I realize that strtol has an ancient
> pedigree, but I do not think it's very good design.

Would you prefer leaving the input argument as char *, or change the
endptr argument to const as well?

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-11-03 17:38:27 Re: ucs_wcwidth vintage
Previous Message Alvaro Herrera 2017-11-03 17:31:55 Re: ucs_wcwidth vintage