From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Jeff Davis <list-pgsql-hackers(at)dynworks(dot)com>, <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: A couple items on TODO |
Date: | 2001-08-24 14:24:27 |
Message-ID: | Pine.LNX.4.30.0108241619080.677-100000@peter.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane writes:
> Yeah, people have started to use 'const' in new code, but the older
> stuff doesn't use it, which means that the net effect is probably
> more annoyance than help. I'm afraid that if we attack this in an
> incremental way, we'll end up with code that may have a lot of const
> markers in the declarations, but the actual code is riddled with
> explicit casts to remove const because at one time or another that
> was necessary in a particular place.
>
> Can anyone think of a way to get from here to there without either
> a lot of leftover cruft, or a "big bang" massive changeover?
What I usually do if I feel a parameter could be made const is to
propagate the change as far as necessary to the underlying functions.
>From time to time this turns out to be impossible at some layer. BUT:
This is an indicator that you really don't know whether the value is const
so you shouldn't declare it thus.
IMHO, a better project than putting const qualifiers all over interfaces
that you are not familiar with would be to clean up all the -Wcast-qual
warnings.
--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter
From | Date | Subject | |
---|---|---|---|
Next Message | Peter T Mount | 2001-08-24 14:27:48 | Re: Toast, Text, blob bytea Huh? |
Previous Message | Peter Eisentraut | 2001-08-24 14:15:05 | Re: Changelog and 7.1.3 release |