Hi,
On 2018-10-15 16:45:03 -0700, Andres Freund wrote:
> I've a patch making .data variables constant, fwiw. Will post in a
> bit. Just so we don't duplicate work too much.
I pushed a few very obvious ones.
An additional fix, for the system attributes in heap.c, is attached. But
that's a bit more invasive, so I wanted to get some input.
I think all of the changes are fairly obvious and the new const
attributes just document what already had to be the case. But to
correctly propagate the const through typedef-the-pointer-away typedefs,
I had to use the underlying type (e.g. use const NameData *n2 instad of
Name n2). To me that's the correct fix, but then I hate these typedefs
with a passion anyway. An alternative fix is to add additional
typedefs like ConstName, but I don't find that particularly
advantageous.
Comments?
Arguably we should use consts more aggresively in signatures anyway, but
I think that's a separate effort.
Greetings,
Andres Freund