Re: [PATCH v4 2/9] Explicit locations: introduce new struct event_location-based API

Pedro Alves
2015-05-19T22:16:43Z

On 05/19/2015 09:41 PM, Keith Seitz wrote:
>> Note to self: Do we need both non-const and const versions?
>> [e.g., treat cached value as mutable in c++ sense?]
>
> Yeah, if we could do something like that in C, that would negate the
> need for both versions. As it is, this seemed the easiest (and not
> an uncommon) way to deal with this. If you have another option, I'm all
> eyes.

You can cast away const for that. See ada_decode_symbol for an example
of exactly that. "const" in C does not mean that the object is set to
stone in read-only storage.

Thanks,
Pedro Alves