I noticed that the argumen to parse_and_eval_type could be "const".
This patch implements this change.
I wonder if this could be removed. It's only called via
check_stub_method_group, which seems questionable to me. However, I
didn't look into doing this.
gdb/ChangeLog
2020-12-13 Tom Tromey <tom@tromey.com>
* gdbtypes.c (safe_parse_type): Make argument const.
* value.h (parse_and_eval_type): Make argument const.
* eval.c (parse_and_eval_type): Make argument const.
+2020-12-13 Tom Tromey <tom@tromey.com>
+
+ * gdbtypes.c (safe_parse_type): Make argument const.
+ * value.h (parse_and_eval_type): Make argument const.
+ * eval.c (parse_and_eval_type): Make argument const.
+
2020-12-13 Andrew Burgess <andrew.burgess@embecosm.com>
* NEWS: Mention new commands.
/* Parse a type expression in the string [P..P+LENGTH). */
struct type *
-parse_and_eval_type (char *p, int length)
+parse_and_eval_type (const char *p, int length)
{
char *tmp = (char *) alloca (length + 4);
occurs, silently return a void type. */
static struct type *
-safe_parse_type (struct gdbarch *gdbarch, char *p, int length)
+safe_parse_type (struct gdbarch *gdbarch, const char *p, int length)
{
struct ui_file *saved_gdb_stderr;
struct type *type = NULL; /* Initialize to keep gcc happy. */
extern struct value *parse_to_comma_and_eval (const char **expp);
-extern struct type *parse_and_eval_type (char *p, int length);
+extern struct type *parse_and_eval_type (const char *p, int length);
extern CORE_ADDR parse_and_eval_address (const char *exp);