Re: [HACKERS] Add some const decorations to prototypes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Add some const decorations to prototypes
Date
Msg-id 20359.1509461767@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] Add some const decorations to prototypes  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [HACKERS] Add some const decorations to prototypes
Re: [HACKERS] Add some const decorations to prototypes
List pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> Here is a patch that adds const decorations to many char * arguments in
> functions.  It should have no impact otherwise; there are very few code
> changes caused by it.

+1 in general ...

> 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.
        regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: [HACKERS] Add some const decorations to prototypes
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Fix dumping pre-10 DBs by pg_dump10 if table "name" exists