[patch 07/12] entryval: "code cleanup": Remove `const' struct value *

Tom Tromey tromey@redhat.com
Tue Jul 19 16:13:00 GMT 2011


>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> this is very mechanical patch just removing `const' from the `struct value
Jan> *original_value' parameter everywhere.
Jan> [patch 10/12] contains lines:
Jan> +  if (VALUE_LVAL (arg) == lval_computed)
Jan> where `arg' must not be `const'.

If this is the only reason, then I would prefer to just add a new
value_lval_const function or something like that.  There is already
precedent for this in value.h.

VALUE_LVAL is a bad API.  We should be getting rid of it, not catering
to it.

Jan> I could implement the check some other simple way but I just think
Jan> `struct value *' should not be passed in C as `const' even if
Jan> intended so as C does not support `const' well.

I agree, but C is what we have for now, and I think the consts provide a
benefit to people reading the code and making changes to it.

Tom



More information about the Gdb-patches mailing list