This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 07/12] entryval: "code cleanup": Remove `const' struct value *
- From: Tom Tromey <tromey at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 19 Jul 2011 08:51:54 -0600
- Subject: Re: [patch 07/12] entryval: "code cleanup": Remove `const' struct value *
- References: <20110718202007.GH30496@host1.jankratochvil.net>
>>>>> "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