Fix gdb build with --enable-build-with-cxx --disable-nls
authorPedro Alves <palves@redhat.com>
Fri, 15 Apr 2016 16:08:53 +0000 (17:08 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 15 Apr 2016 23:32:36 +0000 (00:32 +0100)
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.

gdb/ChangeLog
gdb/ada-lang.c

index f879b8ad346e20601818282335d409248cb0ea71..c83cd02bcd1162a699c63c970acf52a4e3bf1aa3 100644 (file)
@@ -1,3 +1,8 @@
+2016-04-15  Pedro Alves  <palves@redhat.com>
+
+       * ada-lang.c (ada_lookup_struct_elt_type): Constify 'type_str' and
+       'name_str' locals.
+
 2016-04-15  Pedro Alves  <palves@redhat.com>
 
        * btrace.c (pt_btrace_insn_flags): Change return type to
index 7cdb693852d419a2ee2aa05e459bead28d15f93a..d01660a29f90b4b7df8ed2fc32285d9d2919d538 100644 (file)
@@ -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);
This page took 0.031292 seconds and 4 git commands to generate.