On Sat, May 31, 2014 at 5:46 AM, Stephen R. van den Berg srb@cuci.nl wrote:
Chris Angelico wrote:
On Sat, May 31, 2014 at 2:59 AM, Stephen R. van den Berg srb@cuci.nl wrote:
Strictly speaking it only says that the direct struct hash_table element this pointer is pointing at will not be modified in any way. If the struct contains other pointers, the things these pointers point at can be modified, but not if they point back into the current struct hash_table.
I know what the C standard means, I was wondering what it meant in the context of Pike's data structures :) Does it make sense to declare this parameter as const and then tell the compiler that "hey, this bit over here isn't const", or is it better to mark it all as mutable?
Given the fact that we cannot seem to guarantee that even the pointed to element is not modified, it should not be marked as const.
That's what I thought when I did up the patch, but my knowledge of the code is from a quarter-hour of reading it over, not a decade or so of intimate experience with the project :)
ChrisA