From 79f338988c53625a3ab3fba63f06c6ffd224e9ff Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 17 Nov 2015 13:07:24 +0000 Subject: [C++] Add casts to obstack_base calls The recent libiberty import of upstream obstack.h (314dee8ea9be) makes obstack_base return a 'void *', with the consequence that a few places in gdb need a (char *) cast. gdb/ChangeLog: 2015-11-18 Simon Marchi Pedro Alves * break-catch-sig.c (signal_catchpoint_print_one): Add cast. * c-exp.y (parse_string_or_char, yylex): Add casts. * c-lang.c (evaluate_subexp_c): Add casts. * d-exp.y (parse_string_or_char, yylex): Add casts. * go-exp.y (parse_string_or_char, build_packaged_name): Add casts. * p-valprint.c (pascal_object_print_value_fields): Add casts. * valprint.c (generic_emit_char, generic_printstr): Add casts. --- gdb/c-exp.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/c-exp.y') diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 9127756..030e818 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -2247,7 +2247,7 @@ parse_string_or_char (const char *tokptr, const char **outptr, ++tokptr; value->type = type; - value->ptr = obstack_base (&tempbuf); + value->ptr = (char *) obstack_base (&tempbuf); value->length = obstack_object_size (&tempbuf); *outptr = tokptr; @@ -3173,7 +3173,7 @@ yylex (void) obstack_grow (&name_obstack, next->value.sval.ptr, next->value.sval.length); - yylval.sval.ptr = obstack_base (&name_obstack); + yylval.sval.ptr = (const char *) obstack_base (&name_obstack); yylval.sval.length = obstack_object_size (&name_obstack); current.value = yylval; current.token = classification; -- cgit v1.1