Re: const correctness - Mailing list pgsql-hackers

From Robert Haas
Subject Re: const correctness
Date
Msg-id CA+Tgmob0kzqwjXtsJS6aihwJUMVyDWiAH0BkiKTUA343d3xyTg@mail.gmail.com
Whole thread Raw
In response to Re: const correctness  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: const correctness
List pgsql-hackers
On Wed, Nov 9, 2011 at 11:28 AM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
>> The kicker is that it's a lot of work for an unbelievably tiny
>> benefit, sometimes a negative benefit.
>
> Assuming duplicate declarations with and without const are off the
> table, where do you see the negative?

If it doesn't uglify the code, there aren't any negatives.  I'm just
saying we may not be able to get very far before we run up against
that issue.  For example, in the OP, Thomas wrote:

7.  I made a list_head_const function, which can be used used to get a  pointer to the head cell when you have a
pointerto const List; I  needed that so I could make foreach_const and forboth_const; they  were needed to be able to
makelist_member, _equalList and various  other list-visiting functions work with const List objects.
 

So that's already duplicating list_head, foreach, and forboth.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: Collect frequency statistics for arrays
Next
From: Robert Haas
Date:
Subject: Re: parallel make failure