Re: Add some const decorations to prototypes

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some const decorations to prototypes
Date: 2017-11-02 11:01:05
Message-ID: CA+TgmoYjdZ-y9M-Tzy_VHU0tHvJDx_fJwrCSz41ZMB5PZ3g8yA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 31, 2017 at 8:26 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> ... but I'm not sure that it's an improvement in cases where you have to
> cast away the const somewhere else.

I agree. I guess I may be in the minority here but I don't really
like decorating things with const too much because I have tended to
find that once you start adding const, you end up having to add it in
more and more places to avoid warnings, and then eventually that
causes you to have to start casting it away. Perhaps I was just Doing
It Wrong.

Anyway, I don't see much point in having const if you're just going to
have to cast it to non-const. Then it wasn't really very const in the
first place...

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-11-02 11:20:19 Re: pgsql: Fix freezing of a dead HOT-updated tuple
Previous Message Ildus Kurbangaliev 2017-11-02 09:41:01 Re: Custom compression methods