-Wwrite-strings: The Rest
[deliverable/binutils-gdb.git] / gdb / target-descriptions.c
index 33ae1fa7ebceff34d0b2cce5d3e22c7c03cb65e2..9a7e2ddfbd632f4e55f8c8834576dd89ad9c82ee 100644 (file)
@@ -128,8 +128,10 @@ enum tdesc_type_kind
 
 typedef struct tdesc_type
 {
-  /* The name of this type.  */
-  char *name;
+  /* The name of this type.  If this type is a built-in type, this is
+     a pointer to a constant string.  Otherwise, it's a
+     malloc-allocated string (and thus must be freed).  */
+  const char *name;
 
   /* Identify the kind of this type.  */
   enum tdesc_type_kind kind;
@@ -1335,7 +1337,7 @@ tdesc_free_type (struct tdesc_type *type)
       break;
     }
 
-  xfree (type->name);
+  xfree ((char *) type->name);
   xfree (type);
 }
 
This page took 0.024892 seconds and 4 git commands to generate.