aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-04-15 17:08:53 +0100
committerPedro Alves <palves@redhat.com>2016-04-16 00:32:36 +0100
commit2b2798cc9716f45f752ea03411b6f9c9afc17cc6 (patch)
tree489e8f5796745bf8b16a573322fe7b62e9edc838 /gdb/ada-lang.c
parentd7abe1019dbff66b6abfb32df90d0c13328710ee (diff)
Fix gdb build with --enable-build-with-cxx --disable-nls
Compiling gdb with --enable-build-with-cxx --disable-nls, we get: .../src/gdb/ada-lang.c:7657:16: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] type_str = (type != NULL ^ In file included from .../src/gdb/common/common-defs.h:67:0, from .../src/gdb/defs.h:28, from .../src/gdb/ada-lang.c:21: .../src/gdb/common/gdb_locale.h:40:27: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] # define _(String) (String) ^ .../src/gdb/ada-lang.c:7730:46: note: in expansion of macro ‘_’ char *name_str = name != NULL ? name : _("<null>"); ^ Makefile:1140: recipe for target 'ada-lang.o' failed gdb/ChangeLog: 2016-04-15 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_lookup_struct_elt_type): Constify 'type_str' and 'name_str' locals.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 7cdb693852..d01660a29f 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7649,7 +7649,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
|| (TYPE_CODE (type) != TYPE_CODE_STRUCT
&& TYPE_CODE (type) != TYPE_CODE_UNION))
{
- char *type_str;
+ const char *type_str;
if (noerr)
return NULL;
@@ -7727,7 +7727,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
BadName:
if (!noerr)
{
- char *name_str = name != NULL ? name : _("<null>");
+ const char *name_str = name != NULL ? name : _("<null>");
error (_("Type %s has no component named %s"),
type_as_string_and_cleanup (type), name_str);