This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]