public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 03/18] poison "this"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (11 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 12/18] poison "try" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 14/18] poison "using" Ondrej Oprala
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* addrmap.c (self): Renamed from this.
	* cp-namespace.c (this_sym): Likewise.
	* frame.c (self): Likewise.
	* gdbarch.c (self): Regenerate.
	* gdbarch.sh (self): Likewise.
---
 gdb/addrmap.c      | 50 +++++++++++++++++++++++++-------------------------
 gdb/cp-namespace.c |  9 +++++----
 gdb/frame.c        |  8 ++++----
 gdb/gdbarch.c      | 22 +++++++++++-----------
 gdb/gdbarch.sh     | 22 +++++++++++-----------
 5 files changed, 56 insertions(+), 55 deletions(-)

diff --git a/gdb/addrmap.c b/gdb/addrmap.c
index 22694ed..348fd43 100644
--- a/gdb/addrmap.c
+++ b/gdb/addrmap.c
@@ -34,14 +34,14 @@
    implementation.  */
 struct addrmap_funcs
 {
-  void (*set_empty) (struct addrmap *this,
+  void (*set_empty) (struct addrmap *self,
                      CORE_ADDR start, CORE_ADDR end_inclusive,
                      void *obj);
-  void *(*find) (struct addrmap *this, CORE_ADDR addr);
-  struct addrmap *(*create_fixed) (struct addrmap *this,
+  void *(*find) (struct addrmap *self, CORE_ADDR addr);
+  struct addrmap *(*create_fixed) (struct addrmap *self,
                                    struct obstack *obstack);
-  void (*relocate) (struct addrmap *this, CORE_ADDR offset);
-  int (*foreach) (struct addrmap *this, addrmap_foreach_fn fn, void *data);
+  void (*relocate) (struct addrmap *self, CORE_ADDR offset);
+  int (*foreach) (struct addrmap *self, addrmap_foreach_fn fn, void *data);
 };
 
 
@@ -118,7 +118,7 @@ struct addrmap_fixed
 
 
 static void
-addrmap_fixed_set_empty (struct addrmap *this,
+addrmap_fixed_set_empty (struct addrmap *self,
                    CORE_ADDR start, CORE_ADDR end_inclusive,
                    void *obj)
 {
@@ -129,9 +129,9 @@ addrmap_fixed_set_empty (struct addrmap *this,
 
 
 static void *
-addrmap_fixed_find (struct addrmap *this, CORE_ADDR addr)
+addrmap_fixed_find (struct addrmap *self, CORE_ADDR addr)
 {
-  struct addrmap_fixed *map = (struct addrmap_fixed *) this;
+  struct addrmap_fixed *map = (struct addrmap_fixed *) self;
   struct addrmap_transition *bottom = &map->transitions[0];
   struct addrmap_transition *top = &map->transitions[map->num_transitions - 1];
 
@@ -162,7 +162,7 @@ addrmap_fixed_find (struct addrmap *this, CORE_ADDR addr)
 
 
 static struct addrmap *
-addrmap_fixed_create_fixed (struct addrmap *this, struct obstack *obstack)
+addrmap_fixed_create_fixed (struct addrmap *self, struct obstack *obstack)
 {
   internal_error (__FILE__, __LINE__,
                   _("addrmap_create_fixed is not implemented yet "
@@ -171,9 +171,9 @@ addrmap_fixed_create_fixed (struct addrmap *this, struct obstack *obstack)
 
 
 static void
-addrmap_fixed_relocate (struct addrmap *this, CORE_ADDR offset)
+addrmap_fixed_relocate (struct addrmap *self, CORE_ADDR offset)
 {
-  struct addrmap_fixed *map = (struct addrmap_fixed *) this;
+  struct addrmap_fixed *map = (struct addrmap_fixed *) self;
   size_t i;
 
   for (i = 0; i < map->num_transitions; i++)
@@ -182,10 +182,10 @@ addrmap_fixed_relocate (struct addrmap *this, CORE_ADDR offset)
 
 
 static int
-addrmap_fixed_foreach (struct addrmap *this, addrmap_foreach_fn fn,
+addrmap_fixed_foreach (struct addrmap *self, addrmap_foreach_fn fn,
 		       void *data)
 {
-  struct addrmap_fixed *map = (struct addrmap_fixed *) this;
+  struct addrmap_fixed *map = (struct addrmap_fixed *) self;
   size_t i;
 
   for (i = 0; i < map->num_transitions; i++)
@@ -320,26 +320,26 @@ addrmap_splay_tree_insert (struct addrmap_mutable *map,
    tree node at ADDR, even if it would represent a "transition" from
    one value to the same value.  */
 static void
-force_transition (struct addrmap_mutable *this, CORE_ADDR addr)
+force_transition (struct addrmap_mutable *self, CORE_ADDR addr)
 {
   splay_tree_node n
-    = addrmap_splay_tree_lookup (this, addr);
+    = addrmap_splay_tree_lookup (self, addr);
 
   if (! n)
     {
-      n = addrmap_splay_tree_predecessor (this, addr);
-      addrmap_splay_tree_insert (this, addr,
+      n = addrmap_splay_tree_predecessor (self, addr);
+      addrmap_splay_tree_insert (self, addr,
                                  n ? addrmap_node_value (n) : NULL);
     }
 }
 
 
 static void
-addrmap_mutable_set_empty (struct addrmap *this,
+addrmap_mutable_set_empty (struct addrmap *self,
                            CORE_ADDR start, CORE_ADDR end_inclusive,
                            void *obj)
 {
-  struct addrmap_mutable *map = (struct addrmap_mutable *) this;
+  struct addrmap_mutable *map = (struct addrmap_mutable *) self;
   splay_tree_node n, next;
   void *prior_value;
 
@@ -389,7 +389,7 @@ addrmap_mutable_set_empty (struct addrmap *this,
 
 
 static void *
-addrmap_mutable_find (struct addrmap *this, CORE_ADDR addr)
+addrmap_mutable_find (struct addrmap *self, CORE_ADDR addr)
 {
   /* Not needed yet.  */
   internal_error (__FILE__, __LINE__,
@@ -427,9 +427,9 @@ splay_foreach_copy (splay_tree_node n, void *closure)
 
 
 static struct addrmap *
-addrmap_mutable_create_fixed (struct addrmap *this, struct obstack *obstack)
+addrmap_mutable_create_fixed (struct addrmap *self, struct obstack *obstack)
 {
-  struct addrmap_mutable *mutable = (struct addrmap_mutable *) this;
+  struct addrmap_mutable *mutable = (struct addrmap_mutable *) self;
   struct addrmap_fixed *fixed;
   size_t num_transitions;
 
@@ -462,7 +462,7 @@ addrmap_mutable_create_fixed (struct addrmap *this, struct obstack *obstack)
 
 
 static void
-addrmap_mutable_relocate (struct addrmap *this, CORE_ADDR offset)
+addrmap_mutable_relocate (struct addrmap *self, CORE_ADDR offset)
 {
   /* Not needed yet.  */
   internal_error (__FILE__, __LINE__,
@@ -493,10 +493,10 @@ addrmap_mutable_foreach_worker (splay_tree_node node, void *data)
 
 
 static int
-addrmap_mutable_foreach (struct addrmap *this, addrmap_foreach_fn fn,
+addrmap_mutable_foreach (struct addrmap *self, addrmap_foreach_fn fn,
 			 void *data)
 {
-  struct addrmap_mutable *mutable = (struct addrmap_mutable *) this;
+  struct addrmap_mutable *mutable = (struct addrmap_mutable *) self;
   struct mutable_foreach_data foreach_data;
 
   foreach_data.fn = fn;
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index f7db48c..bc5ea10 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -660,16 +660,17 @@ lookup_symbol_file (const char *name,
       if (prefix_len == 0)
 	{
 	  struct type *type;
-	  struct symbol *this;
+	  struct symbol *this_sym;
 
-	  this = lookup_language_this (language_def (language_cplus), block);
-	  if (this == NULL)
+	  this_sym = lookup_language_this (language_def (language_cplus),
+					   block);
+	  if (this_sym == NULL)
 	    {
 	      do_cleanups (cleanup);
 	      return NULL;
 	    }
 
-	  type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (this)));
+	  type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (this_sym)));
 	  klass = xstrdup (TYPE_NAME (type));
 	  nested = xstrdup (name);
 	}
diff --git a/gdb/frame.c b/gdb/frame.c
index 59e31db..fd56c84 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -667,9 +667,9 @@ frame_find_by_id (struct frame_id id)
 
   for (frame = get_current_frame (); ; frame = prev_frame)
     {
-      struct frame_id this = get_frame_id (frame);
+      struct frame_id self = get_frame_id (frame);
 
-      if (frame_id_eq (id, this))
+      if (frame_id_eq (id, self))
 	/* An exact match.  */
 	return frame;
 
@@ -683,7 +683,7 @@ frame_find_by_id (struct frame_id id)
 	 frame in the current frame chain can have this ID.  See the
 	 comment at frame_id_inner for details.   */
       if (get_frame_type (frame) == NORMAL_FRAME
-	  && !frame_id_inner (get_frame_arch (frame), id, this)
+	  && !frame_id_inner (get_frame_arch (frame), id, self)
 	  && frame_id_inner (get_frame_arch (prev_frame), id,
 			     get_frame_id (prev_frame)))
 	return NULL;
@@ -704,7 +704,7 @@ frame_unwind_pc_if_available (struct frame_info *this_frame, CORE_ADDR *pc)
 
 	  /* The right way.  The `pure' way.  The one true way.  This
 	     method depends solely on the register-unwind code to
-	     determine the value of registers in THIS frame, and hence
+	     determine the value of registers in SELF frame, and hence
 	     the value of this frame's PC (resume address).  A typical
 	     implementation is no more than:
 	   
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 1f3380e..396bb67 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -4744,7 +4744,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
   if (new_gdbarch->initialized_p)
     {
       struct gdbarch_list **list;
-      struct gdbarch_list *this;
+      struct gdbarch_list *self;
       if (gdbarch_debug)
 	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
 			    "Previous architecture %s (%s) selected\n",
@@ -4756,12 +4756,12 @@ gdbarch_find_by_info (struct gdbarch_info info)
 	   list = &(*list)->next);
       /* It had better be in the list of architectures.  */
       gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
-      /* Unlink THIS.  */
-      this = (*list);
-      (*list) = this->next;
-      /* Insert THIS at the front.  */
-      this->next = rego->arches;
-      rego->arches = this;
+      /* Unlink SELF.  */
+      self = (*list);
+      (*list) = self->next;
+      /* Insert SELF at the front.  */
+      self->next = rego->arches;
+      rego->arches = self;
       /* Return it.  */
       return new_gdbarch;
     }
@@ -4776,10 +4776,10 @@ gdbarch_find_by_info (struct gdbarch_info info)
   /* Insert the new architecture into the front of the architecture
      list (keep the list sorted Most Recently Used).  */
   {
-    struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
-    this->next = rego->arches;
-    this->gdbarch = new_gdbarch;
-    rego->arches = this;
+    struct gdbarch_list *self = XMALLOC (struct gdbarch_list);
+    self->next = rego->arches;
+    self->gdbarch = new_gdbarch;
+    rego->arches = self;
   }    
 
   /* Check that the newly installed architecture is valid.  Plug in
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 644718d..fa9731d 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -2253,7 +2253,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
   if (new_gdbarch->initialized_p)
     {
       struct gdbarch_list **list;
-      struct gdbarch_list *this;
+      struct gdbarch_list *self;
       if (gdbarch_debug)
 	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
 			    "Previous architecture %s (%s) selected\n",
@@ -2265,12 +2265,12 @@ gdbarch_find_by_info (struct gdbarch_info info)
 	   list = &(*list)->next);
       /* It had better be in the list of architectures.  */
       gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
-      /* Unlink THIS.  */
-      this = (*list);
-      (*list) = this->next;
-      /* Insert THIS at the front.  */
-      this->next = rego->arches;
-      rego->arches = this;
+      /* Unlink SELF.  */
+      self = (*list);
+      (*list) = self->next;
+      /* Insert SELF at the front.  */
+      self->next = rego->arches;
+      rego->arches = self;
       /* Return it.  */
       return new_gdbarch;
     }
@@ -2285,10 +2285,10 @@ gdbarch_find_by_info (struct gdbarch_info info)
   /* Insert the new architecture into the front of the architecture
      list (keep the list sorted Most Recently Used).  */
   {
-    struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
-    this->next = rego->arches;
-    this->gdbarch = new_gdbarch;
-    rego->arches = this;
+    struct gdbarch_list *self = XMALLOC (struct gdbarch_list);
+    self->next = rego->arches;
+    self->gdbarch = new_gdbarch;
+    rego->arches = self;
   }    
 
   /* Check that the newly installed architecture is valid.  Plug in
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 08/18] poison "mutable"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (13 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 14/18] poison "using" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:58 ` [PATCH 16/18] fix up gdbtypes.h Ondrej Oprala
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* addrmap.c (mutable_map): Rename from mutable.
---
 gdb/addrmap.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/addrmap.c b/gdb/addrmap.c
index 348fd43..ccd125c 100644
--- a/gdb/addrmap.c
+++ b/gdb/addrmap.c
@@ -429,16 +429,16 @@ splay_foreach_copy (splay_tree_node n, void *closure)
 static struct addrmap *
 addrmap_mutable_create_fixed (struct addrmap *self, struct obstack *obstack)
 {
-  struct addrmap_mutable *mutable = (struct addrmap_mutable *) self;
+  struct addrmap_mutable *mutable_map = (struct addrmap_mutable *) self;
   struct addrmap_fixed *fixed;
   size_t num_transitions;
 
   /* Count the number of transitions in the tree.  */
   num_transitions = 0;
-  splay_tree_foreach (mutable->tree, splay_foreach_count, &num_transitions);
+  splay_tree_foreach (mutable_map->tree, splay_foreach_count, &num_transitions);
 
   /* Include an extra entry for the transition at zero (which fixed
-     maps have, but mutable maps do not.)  */
+     maps have, but mutable_map maps do not.)  */
   num_transitions++;
 
   fixed = obstack_alloc (obstack,
@@ -452,7 +452,7 @@ addrmap_mutable_create_fixed (struct addrmap *self, struct obstack *obstack)
 
   /* Copy all entries from the splay tree to the array, in order 
      of increasing address.  */
-  splay_tree_foreach (mutable->tree, splay_foreach_copy, fixed);
+  splay_tree_foreach (mutable_map->tree, splay_foreach_copy, fixed);
 
   /* We should have filled the array.  */
   gdb_assert (fixed->num_transitions == num_transitions);
@@ -496,12 +496,12 @@ static int
 addrmap_mutable_foreach (struct addrmap *self, addrmap_foreach_fn fn,
 			 void *data)
 {
-  struct addrmap_mutable *mutable = (struct addrmap_mutable *) self;
+  struct addrmap_mutable *mutable_map = (struct addrmap_mutable *) self;
   struct mutable_foreach_data foreach_data;
 
   foreach_data.fn = fn;
   foreach_data.data = data;
-  return splay_tree_foreach (mutable->tree, addrmap_mutable_foreach_worker,
+  return splay_tree_foreach (mutable_map->tree, addrmap_mutable_foreach_worker,
 			     &foreach_data);
 }
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 01/18] poison "class"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (2 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 15/18] fix up vec Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 09/18] poison "namespace" Ondrej Oprala
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* amd64-tdep.c (reg_class): Renamed from class.
	* c-exp.y (objc_class): Likewise.
	* cli/cli-cmds.c (struct cmd_list_element): Rename field class to cmd_class.
	* cli/cli-decode.c (struct cmd_list_element): Likewise.
	* cli/cli-decode.h (struct cmd_list_element): Likewise.
	* cli/cli-script.c (struct cmd_list_element): Likewise.
	* cli/cli-setshow.c (struct cmd_list_element): Likewise.
	* command.h (cmd_class): Renamed from class.
	* mdebugread.c (addr_class): Likewise.
	* objc-lang.c (struct objc_super): Rename field class to objc_class.
	* parser-defs.h (objc_class): Renamed from class.
	* psymtab.c (addr_class): Likewise.
	* python/py-symbol.c (addr_class): Likewise.
	* top.c (struct cmd_list_element): Rename field class to cmd_class.
---
 gdb/amd64-tdep.c       |  74 ++++++++++++-------------
 gdb/c-exp.y            |  18 +++----
 gdb/cli/cli-cmds.c     |   4 +-
 gdb/cli/cli-decode.c   | 143 +++++++++++++++++++++++++------------------------
 gdb/cli/cli-decode.h   |   2 +-
 gdb/cli/cli-script.c   |  10 ++--
 gdb/cli/cli-setshow.c  |   6 +--
 gdb/command.h          |  24 ++++-----
 gdb/mdebugread.c       |  36 ++++++-------
 gdb/objc-lang.c        |  60 +++++++++++----------
 gdb/parser-defs.h      |   2 +-
 gdb/psymtab.c          |  12 ++---
 gdb/python/py-symbol.c |  25 +++++----
 gdb/top.c              |   2 +-
 14 files changed, 213 insertions(+), 205 deletions(-)

diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 4d6b325..0a74b60 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -456,19 +456,19 @@ amd64_non_pod_p (struct type *type)
    arrays) and union types, and store the result in CLASS.  */
 
 static void
-amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
+amd64_classify_aggregate (struct type *type, enum amd64_reg_class reg_class[2])
 {
   /* 1. If the size of an object is larger than two eightbytes, or in
         C++, is a non-POD structure or union type, or contains
         unaligned fields, it has class memory.  */
   if (TYPE_LENGTH (type) > 16 || amd64_non_pod_p (type))
     {
-      class[0] = class[1] = AMD64_MEMORY;
+      reg_class[0] = reg_class[1] = AMD64_MEMORY;
       return;
     }
 
   /* 2. Both eightbytes get initialized to class NO_CLASS.  */
-  class[0] = class[1] = AMD64_NO_CLASS;
+  reg_class[0] = reg_class[1] = AMD64_NO_CLASS;
 
   /* 3. Each field of an object is classified recursively so that
         always two fields are considered. The resulting class is
@@ -480,9 +480,9 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
       struct type *subtype = check_typedef (TYPE_TARGET_TYPE (type));
 
       /* All fields in an array have the same type.  */
-      amd64_classify (subtype, class);
-      if (TYPE_LENGTH (type) > 8 && class[1] == AMD64_NO_CLASS)
-	class[1] = class[0];
+      amd64_classify (subtype, reg_class);
+      if (TYPE_LENGTH (type) > 8 && reg_class[1] == AMD64_NO_CLASS)
+	reg_class[1] = reg_class[0];
     }
   else
     {
@@ -511,7 +511,7 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
 	  gdb_assert (pos == 0 || pos == 1);
 
 	  amd64_classify (subtype, subclass);
-	  class[pos] = amd64_merge_classes (class[pos], subclass[0]);
+	  reg_class[pos] = amd64_merge_classes (reg_class[pos], subclass[0]);
 	  if (bitsize <= 64 && pos == 0 && endpos == 1)
 	    /* This is a bit of an odd case:  We have a field that would
 	       normally fit in one of the two eightbytes, except that
@@ -535,9 +535,9 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
 	       use up all 16 bytes of the aggregate, and are already
 	       handled just fine (because each portion sits on its own
 	       8-byte).  */
-	    class[1] = amd64_merge_classes (class[1], subclass[0]);
+	    reg_class[1] = amd64_merge_classes (reg_class[1], subclass[0]);
 	  if (pos == 0)
-	    class[1] = amd64_merge_classes (class[1], subclass[1]);
+	    reg_class[1] = amd64_merge_classes (reg_class[1], subclass[1]);
 	}
     }
 
@@ -545,26 +545,26 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
 
   /* Rule (a): If one of the classes is MEMORY, the whole argument is
      passed in memory.  */
-  if (class[0] == AMD64_MEMORY || class[1] == AMD64_MEMORY)
-    class[0] = class[1] = AMD64_MEMORY;
+  if (reg_class[0] == AMD64_MEMORY || reg_class[1] == AMD64_MEMORY)
+    reg_class[0] = reg_class[1] = AMD64_MEMORY;
 
   /* Rule (b): If SSEUP is not preceded by SSE, it is converted to
      SSE.  */
-  if (class[0] == AMD64_SSEUP)
-    class[0] = AMD64_SSE;
-  if (class[1] == AMD64_SSEUP && class[0] != AMD64_SSE)
-    class[1] = AMD64_SSE;
+  if (reg_class[0] == AMD64_SSEUP)
+    reg_class[0] = AMD64_SSE;
+  if (reg_class[1] == AMD64_SSEUP && reg_class[0] != AMD64_SSE)
+    reg_class[1] = AMD64_SSE;
 }
 
 /* Classify TYPE, and store the result in CLASS.  */
 
 static void
-amd64_classify (struct type *type, enum amd64_reg_class class[2])
+amd64_classify (struct type *type, enum amd64_reg_class reg_class[2])
 {
   enum type_code code = TYPE_CODE (type);
   int len = TYPE_LENGTH (type);
 
-  class[0] = class[1] = AMD64_NO_CLASS;
+  reg_class[0] = reg_class[1] = AMD64_NO_CLASS;
 
   /* Arguments of types (signed and unsigned) _Bool, char, short, int,
      long, long long, and pointers are in the INTEGER class.  Similarly,
@@ -575,28 +575,28 @@ amd64_classify (struct type *type, enum amd64_reg_class class[2])
        || code == TYPE_CODE_CHAR
        || code == TYPE_CODE_PTR || code == TYPE_CODE_REF)
       && (len == 1 || len == 2 || len == 4 || len == 8))
-    class[0] = AMD64_INTEGER;
+    reg_class[0] = AMD64_INTEGER;
 
   /* Arguments of types float, double, _Decimal32, _Decimal64 and __m64
      are in class SSE.  */
   else if ((code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT)
 	   && (len == 4 || len == 8))
     /* FIXME: __m64 .  */
-    class[0] = AMD64_SSE;
+    reg_class[0] = AMD64_SSE;
 
   /* Arguments of types __float128, _Decimal128 and __m128 are split into
      two halves.  The least significant ones belong to class SSE, the most
      significant one to class SSEUP.  */
   else if (code == TYPE_CODE_DECFLOAT && len == 16)
     /* FIXME: __float128, __m128.  */
-    class[0] = AMD64_SSE, class[1] = AMD64_SSEUP;
+    reg_class[0] = AMD64_SSE, reg_class[1] = AMD64_SSEUP;
 
   /* The 64-bit mantissa of arguments of type long double belongs to
      class X87, the 16-bit exponent plus 6 bytes of padding belongs to
      class X87UP.  */
   else if (code == TYPE_CODE_FLT && len == 16)
     /* Class X87 and X87UP.  */
-    class[0] = AMD64_X87, class[1] = AMD64_X87UP;
+    reg_class[0] = AMD64_X87, reg_class[1] = AMD64_X87UP;
 
   /* Arguments of complex T where T is one of the types float or
      double get treated as if they are implemented as:
@@ -606,19 +606,19 @@ amd64_classify (struct type *type, enum amd64_reg_class class[2])
        T imag;
      };  */
   else if (code == TYPE_CODE_COMPLEX && len == 8)
-    class[0] = AMD64_SSE;
+    reg_class[0] = AMD64_SSE;
   else if (code == TYPE_CODE_COMPLEX && len == 16)
-    class[0] = class[1] = AMD64_SSE;
+    reg_class[0] = reg_class[1] = AMD64_SSE;
 
   /* A variable of type complex long double is classified as type
      COMPLEX_X87.  */
   else if (code == TYPE_CODE_COMPLEX && len == 32)
-    class[0] = AMD64_COMPLEX_X87;
+    reg_class[0] = AMD64_COMPLEX_X87;
 
   /* Aggregates.  */
   else if (code == TYPE_CODE_ARRAY || code == TYPE_CODE_STRUCT
 	   || code == TYPE_CODE_UNION)
-    amd64_classify_aggregate (type, class);
+    amd64_classify_aggregate (type, reg_class);
 }
 
 static enum return_value_convention
@@ -626,7 +626,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
 		    struct type *type, struct regcache *regcache,
 		    gdb_byte *readbuf, const gdb_byte *writebuf)
 {
-  enum amd64_reg_class class[2];
+  enum amd64_reg_class reg_class[2];
   int len = TYPE_LENGTH (type);
   static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
   static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
@@ -637,7 +637,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
   gdb_assert (!(readbuf && writebuf));
 
   /* 1. Classify the return type with the classification algorithm.  */
-  amd64_classify (type, class);
+  amd64_classify (type, reg_class);
 
   /* 2. If the type has class MEMORY, then the caller provides space
      for the return value and passes the address of this storage in
@@ -646,7 +646,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
 
      On return %rax will contain the address that has been passed in
      by the caller in %rdi.  */
-  if (class[0] == AMD64_MEMORY)
+  if (reg_class[0] == AMD64_MEMORY)
     {
       /* As indicated by the comment above, the ABI guarantees that we
          can always find the return value just after the function has
@@ -665,7 +665,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
 
   /* 8. If the class is COMPLEX_X87, the real part of the value is
         returned in %st0 and the imaginary part in %st1.  */
-  if (class[0] == AMD64_COMPLEX_X87)
+  if (reg_class[0] == AMD64_COMPLEX_X87)
     {
       if (readbuf)
 	{
@@ -687,7 +687,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
       return RETURN_VALUE_REGISTER_CONVENTION;
     }
 
-  gdb_assert (class[1] != AMD64_MEMORY);
+  gdb_assert (reg_class[1] != AMD64_MEMORY);
   gdb_assert (len <= 16);
 
   for (i = 0; len > 0; i++, len -= 8)
@@ -695,7 +695,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
       int regnum = -1;
       int offset = 0;
 
-      switch (class[i])
+      switch (reg_class[i])
 	{
 	case AMD64_INTEGER:
 	  /* 3. If the class is INTEGER, the next available register
@@ -728,7 +728,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
 	case AMD64_X87UP:
 	  /* 7. If the class is X87UP, the value is returned together
              with the previous X87 value in %st0.  */
-	  gdb_assert (i > 0 && class[0] == AMD64_X87);
+	  gdb_assert (i > 0 && reg_class[0] == AMD64_X87);
 	  regnum = AMD64_ST0_REGNUM;
 	  offset = 8;
 	  len = 2;
@@ -792,21 +792,21 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
     {
       struct type *type = value_type (args[i]);
       int len = TYPE_LENGTH (type);
-      enum amd64_reg_class class[2];
+      enum amd64_reg_class reg_class[2];
       int needed_integer_regs = 0;
       int needed_sse_regs = 0;
       int j;
 
       /* Classify argument.  */
-      amd64_classify (type, class);
+      amd64_classify (type, reg_class);
 
       /* Calculate the number of integer and SSE registers needed for
          this argument.  */
       for (j = 0; j < 2; j++)
 	{
-	  if (class[j] == AMD64_INTEGER)
+	  if (reg_class[j] == AMD64_INTEGER)
 	    needed_integer_regs++;
-	  else if (class[j] == AMD64_SSE)
+	  else if (reg_class[j] == AMD64_SSE)
 	    needed_sse_regs++;
 	}
 
@@ -833,7 +833,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
 	      int regnum = -1;
 	      int offset = 0;
 
-	      switch (class[j])
+	      switch (reg_class[j])
 		{
 		case AMD64_INTEGER:
 		  regnum = integer_regnum[integer_reg++];
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 77713dd..a796dbb 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -159,7 +159,7 @@ void yyerror (char *);
 
     struct type_stack *type_stack;
 
-    struct objc_class_str class;
+    struct objc_class_str objc_class;
   }
 
 %{
@@ -206,7 +206,7 @@ static void c_print_token (FILE *file, int type, YYSTYPE value);
 %token <ssym> UNKNOWN_CPP_NAME
 %token <voidval> COMPLETE
 %token <tsym> TYPENAME
-%token <class> CLASSNAME	/* ObjC Class name */
+%token <objc_class> CLASSNAME	/* ObjC Class name */
 %type <sval> name
 %type <svec> string_exp
 %type <ssym> name_not_typename
@@ -470,16 +470,16 @@ exp	:	exp OBJC_LBRAC exp1 ']'
 
 exp	: 	OBJC_LBRAC TYPENAME
 			{
-			  CORE_ADDR class;
+			  CORE_ADDR objc_class;
 
-			  class = lookup_objc_class (parse_gdbarch,
+			  objc_class = lookup_objc_class (parse_gdbarch,
 						     copy_name ($2.stoken));
-			  if (class == 0)
+			  if (objc_class == 0)
 			    error (_("%s is not an ObjC Class"),
 				   copy_name ($2.stoken));
 			  write_exp_elt_opcode (OP_LONG);
 			  write_exp_elt_type (parse_type->builtin_int);
-			  write_exp_elt_longcst ((LONGEST) class);
+			  write_exp_elt_longcst ((LONGEST) objc_class);
 			  write_exp_elt_opcode (OP_LONG);
 			  start_msglist();
 			}
@@ -494,7 +494,7 @@ exp	:	OBJC_LBRAC CLASSNAME
 			{
 			  write_exp_elt_opcode (OP_LONG);
 			  write_exp_elt_type (parse_type->builtin_int);
-			  write_exp_elt_longcst ((LONGEST) $2.class);
+			  write_exp_elt_longcst ((LONGEST) $2.objc_class);
 			  write_exp_elt_opcode (OP_LONG);
 			  start_msglist();
 			}
@@ -2889,10 +2889,10 @@ classify_name (const struct block *block)
       CORE_ADDR Class = lookup_objc_class (parse_gdbarch, copy);
       if (Class)
 	{
-	  yylval.class.class = Class;
+	  yylval.objc_class.objc_class = Class;
 	  sym = lookup_struct_typedef (copy, expression_context_block, 1);
 	  if (sym)
-	    yylval.class.type = SYMBOL_TYPE (sym);
+	    yylval.objc_class.type = SYMBOL_TYPE (sym);
 	  return CLASSNAME;
 	}
     }
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 0ef325d..18aaba1 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1228,7 +1228,7 @@ show_user (char *args, int from_tty)
 
       c = lookup_cmd (&comname, cmdlist, "", 0, 1);
       /* c->user_commands would be NULL if it's a python command.  */
-      if (c->class != class_user || !c->user_commands)
+      if (c->cmd_class != class_user || !c->user_commands)
 	error (_("Not a user command."));
       show_user_1 (c, "", args, gdb_stdout);
     }
@@ -1236,7 +1236,7 @@ show_user (char *args, int from_tty)
     {
       for (c = cmdlist; c; c = c->next)
 	{
-	  if (c->class == class_user || c->prefixlist != NULL)
+	  if (c->cmd_class == class_user || c->prefixlist != NULL)
 	    show_user_1 (c, "", c->name, gdb_stdout);
 	}
     }
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 7e315c1..9d82bd0 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -183,8 +183,8 @@ set_cmd_completer (struct cmd_list_element *cmd, completer_ftype *completer)
    of *LIST).  */
 
 struct cmd_list_element *
-add_cmd (const char *name, enum command_class class, void (*fun) (char *, int),
-	 char *doc, struct cmd_list_element **list)
+add_cmd (const char *name, enum command_class cmd_class,
+	 void (*fun) (char *, int), char *doc, struct cmd_list_element **list)
 {
   struct cmd_list_element *c
     = (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
@@ -222,7 +222,7 @@ add_cmd (const char *name, enum command_class class, void (*fun) (char *, int),
     }
 
   c->name = name;
-  c->class = class;
+  c->cmd_class = cmd_class;
   set_cmd_cfunc (c, fun);
   set_cmd_context (c, NULL);
   c->doc = doc;
@@ -272,8 +272,9 @@ deprecate_cmd (struct cmd_list_element *cmd, char *replacement)
 }
 
 struct cmd_list_element *
-add_alias_cmd (const char *name, const char *oldname, enum command_class class,
-	       int abbrev_flag, struct cmd_list_element **list)
+add_alias_cmd (const char *name, const char *oldname,
+	       enum command_class cmd_class, int abbrev_flag,
+	       struct cmd_list_element **list)
 {
   const char *tmp;
   struct cmd_list_element *old;
@@ -295,7 +296,7 @@ add_alias_cmd (const char *name, const char *oldname, enum command_class class,
       return 0;
     }
 
-  c = add_cmd (name, class, NULL, old->doc, list);
+  c = add_cmd (name, cmd_class, NULL, old->doc, list);
 
   /* If OLD->DOC can be freed, we should make another copy.  */
   if ((old->flags & DOC_ALLOCATED) != 0)
@@ -324,13 +325,13 @@ add_alias_cmd (const char *name, const char *oldname, enum command_class class,
    containing that list.  */
 
 struct cmd_list_element *
-add_prefix_cmd (const char *name, enum command_class class,
+add_prefix_cmd (const char *name, enum command_class cmd_class,
 		void (*fun) (char *, int),
 		char *doc, struct cmd_list_element **prefixlist,
 		char *prefixname, int allow_unknown,
 		struct cmd_list_element **list)
 {
-  struct cmd_list_element *c = add_cmd (name, class, fun, doc, list);
+  struct cmd_list_element *c = add_cmd (name, cmd_class, fun, doc, list);
   struct cmd_list_element *p;
 
   c->prefixlist = prefixlist;
@@ -352,12 +353,12 @@ add_prefix_cmd (const char *name, enum command_class class,
 /* Like add_prefix_cmd but sets the abbrev_flag on the new command.  */
 
 struct cmd_list_element *
-add_abbrev_prefix_cmd (const char *name, enum command_class class,
+add_abbrev_prefix_cmd (const char *name, enum command_class cmd_class,
 		       void (*fun) (char *, int), char *doc,
 		       struct cmd_list_element **prefixlist, char *prefixname,
 		       int allow_unknown, struct cmd_list_element **list)
 {
-  struct cmd_list_element *c = add_cmd (name, class, fun, doc, list);
+  struct cmd_list_element *c = add_cmd (name, cmd_class, fun, doc, list);
 
   c->prefixlist = prefixlist;
   c->prefixname = prefixname;
@@ -383,7 +384,7 @@ empty_sfunc (char *args, int from_tty, struct cmd_list_element *c)
 /* Add element named NAME to command list LIST (the list for set/show
    or some sublist thereof).
    TYPE is set_cmd or show_cmd.
-   CLASS is as in add_cmd.
+   KLASS is as in add_cmd.
    VAR_TYPE is the kind of thing we are setting.
    VAR is address of the variable being controlled by this command.
    DOC is the documentation string.  */
@@ -391,13 +392,13 @@ empty_sfunc (char *args, int from_tty, struct cmd_list_element *c)
 static struct cmd_list_element *
 add_set_or_show_cmd (const char *name,
 		     enum cmd_types type,
-		     enum command_class class,
+		     enum command_class cmd_class,
 		     var_types var_type,
 		     void *var,
 		     char *doc,
 		     struct cmd_list_element **list)
 {
-  struct cmd_list_element *c = add_cmd (name, class, NULL, doc, list);
+  struct cmd_list_element *c = add_cmd (name, cmd_class, NULL, doc, list);
 
   gdb_assert (type == set_cmd || type == show_cmd);
   c->type = type;
@@ -410,7 +411,7 @@ add_set_or_show_cmd (const char *name,
 }
 
 /* Add element named NAME to both the command SET_LIST and SHOW_LIST.
-   CLASS is as in add_cmd.  VAR_TYPE is the kind of thing we are
+   KLASS is as in add_cmd.  VAR_TYPE is the kind of thing we are
    setting.  VAR is address of the variable being controlled by this
    command.  SET_FUNC and SHOW_FUNC are the callback functions (if
    non-NULL).  SET_DOC, SHOW_DOC and HELP_DOC are the documentation
@@ -420,7 +421,7 @@ add_set_or_show_cmd (const char *name,
 
 static void
 add_setshow_cmd_full (const char *name,
-		      enum command_class class,
+		      enum command_class cmd_class,
 		      var_types var_type, void *var,
 		      const char *set_doc, const char *show_doc,
 		      const char *help_doc,
@@ -446,7 +447,7 @@ add_setshow_cmd_full (const char *name,
       full_set_doc = xstrdup (set_doc);
       full_show_doc = xstrdup (show_doc);
     }
-  set = add_set_or_show_cmd (name, set_cmd, class, var_type, var,
+  set = add_set_or_show_cmd (name, set_cmd, cmd_class, var_type, var,
 			     full_set_doc, set_list);
   set->flags |= DOC_ALLOCATED;
 
@@ -455,7 +456,7 @@ add_setshow_cmd_full (const char *name,
 
   set_cmd_prefix (set, set_list);
 
-  show = add_set_or_show_cmd (name, show_cmd, class, var_type, var,
+  show = add_set_or_show_cmd (name, show_cmd, cmd_class, var_type, var,
 			      full_show_doc, show_list);
   show->flags |= DOC_ALLOCATED;
   show->show_value_func = show_func;
@@ -467,13 +468,13 @@ add_setshow_cmd_full (const char *name,
 }
 
 /* Add element named NAME to command list LIST (the list for set or
-   some sublist thereof).  CLASS is as in add_cmd.  ENUMLIST is a list
+   some sublist thereof).  KLASS is as in add_cmd.  ENUMLIST is a list
    of strings which may follow NAME.  VAR is address of the variable
    which will contain the matching string (from ENUMLIST).  */
 
 void
 add_setshow_enum_cmd (const char *name,
-		      enum command_class class,
+		      enum command_class cmd_class,
 		      const char *const *enumlist,
 		      const char **var,
 		      const char *set_doc,
@@ -486,7 +487,7 @@ add_setshow_enum_cmd (const char *name,
 {
   struct cmd_list_element *c;
 
-  add_setshow_cmd_full (name, class, var_enum, var,
+  add_setshow_cmd_full (name, cmd_class, var_enum, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -497,12 +498,12 @@ add_setshow_enum_cmd (const char *name,
 const char * const auto_boolean_enums[] = { "on", "off", "auto", NULL };
 
 /* Add an auto-boolean command named NAME to both the set and show
-   command list lists.  CLASS is as in add_cmd.  VAR is address of the
+   command list lists.  KLASS is as in add_cmd.  VAR is address of the
    variable which will contain the value.  DOC is the documentation
    string.  FUNC is the corresponding callback.  */
 void
 add_setshow_auto_boolean_cmd (const char *name,
-			      enum command_class class,
+			      enum command_class cmd_class,
 			      enum auto_boolean *var,
 			      const char *set_doc, const char *show_doc,
 			      const char *help_doc,
@@ -513,7 +514,7 @@ add_setshow_auto_boolean_cmd (const char *name,
 {
   struct cmd_list_element *c;
 
-  add_setshow_cmd_full (name, class, var_auto_boolean, var,
+  add_setshow_cmd_full (name, cmd_class, var_auto_boolean, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -522,11 +523,12 @@ add_setshow_auto_boolean_cmd (const char *name,
 }
 
 /* Add element named NAME to both the set and show command LISTs (the
-   list for set/show or some sublist thereof).  CLASS is as in
+   list for set/show or some sublist thereof).  KLASS is as in
    add_cmd.  VAR is address of the variable which will contain the
    value.  SET_DOC and SHOW_DOC are the documentation strings.  */
 void
-add_setshow_boolean_cmd (const char *name, enum command_class class, int *var,
+add_setshow_boolean_cmd (const char *name, enum command_class cmd_class,
+			 int *var,
 			 const char *set_doc, const char *show_doc,
 			 const char *help_doc,
 			 cmd_sfunc_ftype *set_func,
@@ -537,7 +539,7 @@ add_setshow_boolean_cmd (const char *name, enum command_class class, int *var,
   static const char *boolean_enums[] = { "on", "off", NULL };
   struct cmd_list_element *c;
 
-  add_setshow_cmd_full (name, class, var_boolean, var,
+  add_setshow_cmd_full (name, cmd_class, var_boolean, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -548,7 +550,7 @@ add_setshow_boolean_cmd (const char *name, enum command_class class, int *var,
 /* Add element named NAME to both the set and show command LISTs (the
    list for set/show or some sublist thereof).  */
 void
-add_setshow_filename_cmd (const char *name, enum command_class class,
+add_setshow_filename_cmd (const char *name, enum command_class cmd_class,
 			  char **var,
 			  const char *set_doc, const char *show_doc,
 			  const char *help_doc,
@@ -559,7 +561,7 @@ add_setshow_filename_cmd (const char *name, enum command_class class,
 {
   struct cmd_list_element *set_result;
 
-  add_setshow_cmd_full (name, class, var_filename, var,
+  add_setshow_cmd_full (name, cmd_class, var_filename, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -570,7 +572,7 @@ add_setshow_filename_cmd (const char *name, enum command_class class,
 /* Add element named NAME to both the set and show command LISTs (the
    list for set/show or some sublist thereof).  */
 void
-add_setshow_string_cmd (const char *name, enum command_class class,
+add_setshow_string_cmd (const char *name, enum command_class cmd_class,
 			char **var,
 			const char *set_doc, const char *show_doc,
 			const char *help_doc,
@@ -579,7 +581,7 @@ add_setshow_string_cmd (const char *name, enum command_class class,
 			struct cmd_list_element **set_list,
 			struct cmd_list_element **show_list)
 {
-  add_setshow_cmd_full (name, class, var_string, var,
+  add_setshow_cmd_full (name, cmd_class, var_string, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -589,7 +591,7 @@ add_setshow_string_cmd (const char *name, enum command_class class,
 /* Add element named NAME to both the set and show command LISTs (the
    list for set/show or some sublist thereof).  */
 struct cmd_list_element *
-add_setshow_string_noescape_cmd (const char *name, enum command_class class,
+add_setshow_string_noescape_cmd (const char *name, enum command_class cmd_class,
 				 char **var,
 				 const char *set_doc, const char *show_doc,
 				 const char *help_doc,
@@ -600,7 +602,7 @@ add_setshow_string_noescape_cmd (const char *name, enum command_class class,
 {
   struct cmd_list_element *set_cmd;
 
-  add_setshow_cmd_full (name, class, var_string_noescape, var,
+  add_setshow_cmd_full (name, cmd_class, var_string_noescape, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -611,7 +613,8 @@ add_setshow_string_noescape_cmd (const char *name, enum command_class class,
 /* Add element named NAME to both the set and show command LISTs (the
    list for set/show or some sublist thereof).  */
 void
-add_setshow_optional_filename_cmd (const char *name, enum command_class class,
+add_setshow_optional_filename_cmd (const char *name,
+				   enum command_class cmd_class,
 				   char **var,
 				   const char *set_doc, const char *show_doc,
 				   const char *help_doc,
@@ -622,7 +625,7 @@ add_setshow_optional_filename_cmd (const char *name, enum command_class class,
 {
   struct cmd_list_element *set_result;
  
-  add_setshow_cmd_full (name, class, var_optional_filename, var,
+  add_setshow_cmd_full (name, cmd_class, var_optional_filename, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -649,12 +652,12 @@ integer_unlimited_completer (struct cmd_list_element *ignore,
 }
 
 /* Add element named NAME to both the set and show command LISTs (the
-   list for set/show or some sublist thereof).  CLASS is as in
+   list for set/show or some sublist thereof).  KLASS is as in
    add_cmd.  VAR is address of the variable which will contain the
    value.  SET_DOC and SHOW_DOC are the documentation strings.  This
    function is only used in Python API.  Please don't use it elsewhere.  */
 void
-add_setshow_integer_cmd (const char *name, enum command_class class,
+add_setshow_integer_cmd (const char *name, enum command_class cmd_class,
 			 int *var,
 			 const char *set_doc, const char *show_doc,
 			 const char *help_doc,
@@ -665,7 +668,7 @@ add_setshow_integer_cmd (const char *name, enum command_class class,
 {
   struct cmd_list_element *set;
 
-  add_setshow_cmd_full (name, class, var_integer, var,
+  add_setshow_cmd_full (name, cmd_class, var_integer, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -675,11 +678,11 @@ add_setshow_integer_cmd (const char *name, enum command_class class,
 }
 
 /* Add element named NAME to both the set and show command LISTs (the
-   list for set/show or some sublist thereof).  CLASS is as in
+   list for set/show or some sublist thereof).  KLASS is as in
    add_cmd.  VAR is address of the variable which will contain the
    value.  SET_DOC and SHOW_DOC are the documentation strings.  */
 void
-add_setshow_uinteger_cmd (const char *name, enum command_class class,
+add_setshow_uinteger_cmd (const char *name, enum command_class cmd_class,
 			  unsigned int *var,
 			  const char *set_doc, const char *show_doc,
 			  const char *help_doc,
@@ -690,7 +693,7 @@ add_setshow_uinteger_cmd (const char *name, enum command_class class,
 {
   struct cmd_list_element *set;
 
-  add_setshow_cmd_full (name, class, var_uinteger, var,
+  add_setshow_cmd_full (name, cmd_class, var_uinteger, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -700,11 +703,11 @@ add_setshow_uinteger_cmd (const char *name, enum command_class class,
 }
 
 /* Add element named NAME to both the set and show command LISTs (the
-   list for set/show or some sublist thereof).  CLASS is as in
+   list for set/show or some sublist thereof).  KLASS is as in
    add_cmd.  VAR is address of the variable which will contain the
    value.  SET_DOC and SHOW_DOC are the documentation strings.  */
 void
-add_setshow_zinteger_cmd (const char *name, enum command_class class,
+add_setshow_zinteger_cmd (const char *name, enum command_class cmd_class,
 			  int *var,
 			  const char *set_doc, const char *show_doc,
 			  const char *help_doc,
@@ -713,7 +716,7 @@ add_setshow_zinteger_cmd (const char *name, enum command_class class,
 			  struct cmd_list_element **set_list,
 			  struct cmd_list_element **show_list)
 {
-  add_setshow_cmd_full (name, class, var_zinteger, var,
+  add_setshow_cmd_full (name, cmd_class, var_zinteger, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -722,7 +725,7 @@ add_setshow_zinteger_cmd (const char *name, enum command_class class,
 
 void
 add_setshow_zuinteger_unlimited_cmd (const char *name,
-				     enum command_class class,
+				     enum command_class cmd_class,
 				     int *var,
 				     const char *set_doc,
 				     const char *show_doc,
@@ -734,7 +737,7 @@ add_setshow_zuinteger_unlimited_cmd (const char *name,
 {
   struct cmd_list_element *set;
 
-  add_setshow_cmd_full (name, class, var_zuinteger_unlimited, var,
+  add_setshow_cmd_full (name, cmd_class, var_zuinteger_unlimited, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -744,11 +747,11 @@ add_setshow_zuinteger_unlimited_cmd (const char *name,
 }
 
 /* Add element named NAME to both the set and show command LISTs (the
-   list for set/show or some sublist thereof).  CLASS is as in
+   list for set/show or some sublist thereof).  KLASS is as in
    add_cmd.  VAR is address of the variable which will contain the
    value.  SET_DOC and SHOW_DOC are the documentation strings.  */
 void
-add_setshow_zuinteger_cmd (const char *name, enum command_class class,
+add_setshow_zuinteger_cmd (const char *name, enum command_class cmd_class,
 			   unsigned int *var,
 			   const char *set_doc, const char *show_doc,
 			   const char *help_doc,
@@ -757,7 +760,7 @@ add_setshow_zuinteger_cmd (const char *name, enum command_class class,
 			   struct cmd_list_element **set_list,
 			   struct cmd_list_element **show_list)
 {
-  add_setshow_cmd_full (name, class, var_zuinteger, var,
+  add_setshow_cmd_full (name, cmd_class, var_zuinteger, var,
 			set_doc, show_doc, help_doc,
 			set_func, show_func,
 			set_list, show_list,
@@ -858,19 +861,19 @@ add_info_alias (const char *name, char *oldname, int abbrev_flag)
 /* Add an element to the list of commands.  */
 
 struct cmd_list_element *
-add_com (const char *name, enum command_class class, void (*fun) (char *, int),
-	 char *doc)
+add_com (const char *name, enum command_class cmd_class,
+	 void (*fun) (char *, int), char *doc)
 {
-  return add_cmd (name, class, fun, doc, &cmdlist);
+  return add_cmd (name, cmd_class, fun, doc, &cmdlist);
 }
 
 /* Add an alias or abbreviation command to the list of commands.  */
 
 struct cmd_list_element *
-add_com_alias (const char *name, const char *oldname, enum command_class class,
-	       int abbrev_flag)
+add_com_alias (const char *name, const char *oldname,
+	       enum command_class cmd_class, int abbrev_flag)
 {
-  return add_alias_cmd (name, oldname, class, abbrev_flag, &cmdlist);
+  return add_alias_cmd (name, oldname, cmd_class, abbrev_flag, &cmdlist);
 }
 \f
 /* Recursively walk the commandlist structures, and print out the
@@ -980,7 +983,7 @@ help_cmd (char *arg, struct ui_file *stream)
 
   /* If this is a class name, print all of the commands in the class.  */
   if (c->func == NULL)
-    help_list (cmdlist, "", c->class, stream);
+    help_list (cmdlist, "", c->cmd_class, stream);
 
   if (c->hook_pre || c->hook_post)
     fprintf_filtered (stream,
@@ -1001,7 +1004,7 @@ help_cmd (char *arg, struct ui_file *stream)
  *
  * LIST is the list.
  * CMDTYPE is the prefix to use in the title string.
- * CLASS is the class with which to list the nodes of this list (see
+ * KLASS is the class with which to list the nodes of this list (see
  * documentation for help_cmd_list below),  As usual, ALL_COMMANDS for
  * everything, ALL_CLASSES for just classes, and non-negative for only things
  * in a specific class.
@@ -1010,7 +1013,7 @@ help_cmd (char *arg, struct ui_file *stream)
  */
 void
 help_list (struct cmd_list_element *list, char *cmdtype,
-	   enum command_class class, struct ui_file *stream)
+	   enum command_class cmd_class, struct ui_file *stream)
 {
   int len;
   char *cmdtype1, *cmdtype2;
@@ -1031,14 +1034,14 @@ help_list (struct cmd_list_element *list, char *cmdtype,
       strcpy (cmdtype2 + len - 1, " sub");
     }
 
-  if (class == all_classes)
+  if (cmd_class == all_classes)
     fprintf_filtered (stream, "List of classes of %scommands:\n\n", cmdtype2);
   else
     fprintf_filtered (stream, "List of %scommands:\n\n", cmdtype2);
 
-  help_cmd_list (list, class, cmdtype, (int) class >= 0, stream);
+  help_cmd_list (list, cmd_class, cmdtype, (int) cmd_class >= 0, stream);
 
-  if (class == all_classes)
+  if (cmd_class == all_classes)
     {
       fprintf_filtered (stream, "\n\
 Type \"help%s\" followed by a class name for a list of commands in ",
@@ -1080,7 +1083,7 @@ help_all (struct ui_file *stream)
       if (c->func == NULL)
 	{
 	  fprintf_filtered (stream, "\nCommand class: %s\n\n", c->name);
-	  help_cmd_list (cmdlist, c->class, "", 1, stream);
+	  help_cmd_list (cmdlist, c->cmd_class, "", 1, stream);
 	}
     }
 
@@ -1093,7 +1096,7 @@ help_all (struct ui_file *stream)
       if (c->abbrev_flag)
         continue;
 
-      if (c->class == no_class)
+      if (c->cmd_class == no_class)
 	{
 	  if (!seen_unclassified)
 	    {
@@ -1154,7 +1157,7 @@ print_help_for_command (struct cmd_list_element *c, char *prefix, int recurse,
       && c->prefixlist != 0
       && c->abbrev_flag == 0)
     /* Subcommands of a prefix command typically have 'all_commands'
-       as class.  If we pass CLASS to recursive invocation,
+       as class.  If we pass KLASS to recursive invocation,
        most often we won't see anything.  */
     help_cmd_list (*c->prefixlist, all_commands, c->prefixname, 1, stream);
 }
@@ -1165,7 +1168,7 @@ print_help_for_command (struct cmd_list_element *c, char *prefix, int recurse,
  * all sublists of LIST.
  * PREFIX is the prefix to print before each command name.
  * STREAM is the stream upon which the output should be written.
- * CLASS should be:
+ * KLASS should be:
  *      A non-negative class number to list only commands in that
  * class.
  *      ALL_COMMANDS to list all commands in list.
@@ -1176,7 +1179,7 @@ print_help_for_command (struct cmd_list_element *c, char *prefix, int recurse,
  * is at the low level, not the high-level).
  */
 void
-help_cmd_list (struct cmd_list_element *list, enum command_class class,
+help_cmd_list (struct cmd_list_element *list, enum command_class cmd_class,
 	       char *prefix, int recurse, struct ui_file *stream)
 {
   struct cmd_list_element *c;
@@ -1184,16 +1187,16 @@ help_cmd_list (struct cmd_list_element *list, enum command_class class,
   for (c = list; c; c = c->next)
     {      
       if (c->abbrev_flag == 0
-	  && (class == all_commands
-	      || (class == all_classes && c->func == NULL)
-	      || (class == c->class && c->func != NULL)))
+	  && (cmd_class == all_commands
+	      || (cmd_class == all_classes && c->func == NULL)
+	      || (cmd_class == c->cmd_class && c->func != NULL)))
 	{
 	  print_help_for_command (c, prefix, recurse, stream);
 	}
       else if (c->abbrev_flag == 0 && recurse
-	       && class == class_user && c->prefixlist != NULL)
+	       && cmd_class == class_user && c->prefixlist != NULL)
 	/* User-defined commands may be subcommands.  */
-	help_cmd_list (*c->prefixlist, class, c->prefixname, 
+	help_cmd_list (*c->prefixlist, cmd_class, c->prefixname,
 		       recurse, stream);
     }
 }
diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index bf4dd1d..c34311e 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -62,7 +62,7 @@ struct cmd_list_element
     const char *name;
 
     /* Command class; class values are chosen by application program.  */
-    enum command_class class;
+    enum command_class cmd_class;
 
     /* Function definition of this command.  NULL for command class
        names and for help topics that are not really commands.  NOTE:
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 6ea3243..0dad6f3 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -1476,7 +1476,7 @@ define_command (char *comname, int from_tty)
     {
       int q;
 
-      if (c->class == class_user || c->class == class_alias)
+      if (c->cmd_class == class_user || c->cmd_class == class_alias)
 	q = query (_("Redefine command \"%s\"? "), c->name);
       else
 	q = query (_("Really redefine built-in command \"%s\"? "), c->name);
@@ -1528,11 +1528,11 @@ define_command (char *comname, int from_tty)
 	     "Type commands for definition of \"%s\".", comfull);
   cmds = read_command_lines (tmpbuf, from_tty, 1, 0, 0);
 
-  if (c && c->class == class_user)
+  if (c && c->cmd_class == class_user)
     free_command_lines (&c->user_commands);
 
   newc = add_cmd (comname, class_user, user_defined_command,
-		  (c && c->class == class_user)
+		  (c && c->cmd_class == class_user)
 		  ? c->doc : xstrdup ("User-defined."), list);
   newc->user_commands = cmds;
 
@@ -1573,7 +1573,7 @@ document_command (char *comname, int from_tty)
   tem = comname;
   c = lookup_cmd (&tem, *list, "", 0, 1);
 
-  if (c->class != class_user)
+  if (c->cmd_class != class_user)
     error (_("Command \"%s\" is built-in."), comfull);
 
   xsnprintf (tmpbuf, sizeof (tmpbuf), "Type documentation for \"%s\".",
@@ -1677,7 +1677,7 @@ show_user_1 (struct cmd_list_element *c, const char *prefix, const char *name,
       char *prefixname = c->prefixname;
 
       for (c = *c->prefixlist; c != NULL; c = c->next)
-	if (c->class == class_user || c->prefixlist != NULL)
+	if (c->cmd_class == class_user || c->prefixlist != NULL)
 	  show_user_1 (c, prefixname, c->name, gdb_stdout);
       return;
     }
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 45df6f6..0cd36c2 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -38,8 +38,8 @@ notify_command_param_changed_p (int param_changed, struct cmd_list_element *c)
   if (param_changed == 0)
     return 0;
 
-  if (c->class == class_maintenance || c->class == class_deprecated
-      || c->class == class_obscure)
+  if (c->cmd_class == class_maintenance || c->cmd_class == class_deprecated
+      || c->cmd_class == class_obscure)
     return 0;
 
   return 1;
@@ -694,7 +694,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix)
 	}
       else
 	{
-	  if (list->class != no_set_class)
+	  if (list->cmd_class != no_set_class)
 	    {
 	      struct cleanup *option_chain
 		= make_cleanup_ui_out_tuple_begin_end (uiout, "option");
diff --git a/gdb/command.h b/gdb/command.h
index 81edc43..37a6acf 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -238,7 +238,7 @@ typedef void (show_value_ftype) (struct ui_file *file,
 extern show_value_ftype deprecated_show_value_hack;
 
 extern void add_setshow_enum_cmd (const char *name,
-				  enum command_class class,
+				  enum command_class cmd_class,
 				  const char *const *enumlist,
 				  const char **var,
 				  const char *set_doc,
@@ -250,7 +250,7 @@ extern void add_setshow_enum_cmd (const char *name,
 				  struct cmd_list_element **show_list);
 
 extern void add_setshow_auto_boolean_cmd (const char *name,
-					  enum command_class class,
+					  enum command_class cmd_class,
 					  enum auto_boolean *var,
 					  const char *set_doc,
 					  const char *show_doc,
@@ -261,7 +261,7 @@ extern void add_setshow_auto_boolean_cmd (const char *name,
 					  struct cmd_list_element **show_list);
 
 extern void add_setshow_boolean_cmd (const char *name,
-				     enum command_class class,
+				     enum command_class cmd_class,
 				     int *var,
 				     const char *set_doc, const char *show_doc,
 				     const char *help_doc,
@@ -271,7 +271,7 @@ extern void add_setshow_boolean_cmd (const char *name,
 				     struct cmd_list_element **show_list);
 
 extern void add_setshow_filename_cmd (const char *name,
-				      enum command_class class,
+				      enum command_class cmd_class,
 				      char **var,
 				      const char *set_doc,
 				      const char *show_doc,
@@ -282,7 +282,7 @@ extern void add_setshow_filename_cmd (const char *name,
 				      struct cmd_list_element **show_list);
 
 extern void add_setshow_string_cmd (const char *name,
-				    enum command_class class,
+				    enum command_class cmd_class,
 				    char **var,
 				    const char *set_doc,
 				    const char *show_doc,
@@ -294,7 +294,7 @@ extern void add_setshow_string_cmd (const char *name,
 
 extern struct cmd_list_element *add_setshow_string_noescape_cmd
 		      (const char *name,
-		       enum command_class class,
+		       enum command_class cmd_class,
 		       char **var,
 		       const char *set_doc,
 		       const char *show_doc,
@@ -305,7 +305,7 @@ extern struct cmd_list_element *add_setshow_string_noescape_cmd
 		       struct cmd_list_element **show_list);
 
 extern void add_setshow_optional_filename_cmd (const char *name,
-					       enum command_class class,
+					       enum command_class cmd_class,
 					       char **var,
 					       const char *set_doc,
 					       const char *show_doc,
@@ -316,7 +316,7 @@ extern void add_setshow_optional_filename_cmd (const char *name,
 					       struct cmd_list_element **show_list);
 
 extern void add_setshow_integer_cmd (const char *name,
-				     enum command_class class,
+				     enum command_class cmd_class,
 				     int *var,
 				     const char *set_doc,
 				     const char *show_doc,
@@ -327,7 +327,7 @@ extern void add_setshow_integer_cmd (const char *name,
 				     struct cmd_list_element **show_list);
 
 extern void add_setshow_uinteger_cmd (const char *name,
-				      enum command_class class,
+				      enum command_class cmd_class,
 				      unsigned int *var,
 				      const char *set_doc,
 				      const char *show_doc,
@@ -338,7 +338,7 @@ extern void add_setshow_uinteger_cmd (const char *name,
 				      struct cmd_list_element **show_list);
 
 extern void add_setshow_zinteger_cmd (const char *name,
-				      enum command_class class,
+				      enum command_class cmd_class,
 				      int *var,
 				      const char *set_doc,
 				      const char *show_doc,
@@ -349,7 +349,7 @@ extern void add_setshow_zinteger_cmd (const char *name,
 				      struct cmd_list_element **show_list);
 
 extern void add_setshow_zuinteger_cmd (const char *name,
-				       enum command_class class,
+				       enum command_class cmd_class,
 				       unsigned int *var,
 				       const char *set_doc,
 				       const char *show_doc,
@@ -361,7 +361,7 @@ extern void add_setshow_zuinteger_cmd (const char *name,
 
 extern void
   add_setshow_zuinteger_unlimited_cmd (const char *name,
-				       enum command_class class,
+				       enum command_class cmd_class,
 				       int *var,
 				       const char *set_doc,
 				       const char *show_doc,
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 5549610..c27b114 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -561,7 +561,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
   struct type *t;
   struct field *f;
   int count = 1;
-  enum address_class class;
+  enum address_class addr_class;
   TIR tir;
   long svalue = sh->value;
   int bitsize;
@@ -602,7 +602,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       break;
 
     case stGlobal:		/* External symbol, goes into global block.  */
-      class = LOC_STATIC;
+      addr_class = LOC_STATIC;
       b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st),
 			     GLOBAL_BLOCK);
       s = new_symbol (name);
@@ -610,7 +610,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       goto data;
 
     case stStatic:		/* Static data, goes into current block.  */
-      class = LOC_STATIC;
+      addr_class = LOC_STATIC;
       b = top_stack->cur_block;
       s = new_symbol (name);
       if (SC_IS_COMMON (sh->sc))
@@ -631,13 +631,13 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       s = new_symbol (name);
       SYMBOL_VALUE (s) = svalue;
       if (sh->sc == scRegister)
-	class = mdebug_register_index;
+	addr_class = mdebug_register_index;
       else
-	class = LOC_LOCAL;
+	addr_class = LOC_LOCAL;
 
     data:			/* Common code for symbols describing data.  */
       SYMBOL_DOMAIN (s) = VAR_DOMAIN;
-      SYMBOL_ACLASS_INDEX (s) = class;
+      SYMBOL_ACLASS_INDEX (s) = addr_class;
       add_symbol (s, top_stack->cur_st, b);
 
       /* Type could be missing if file is compiled without debugging info.  */
@@ -3434,7 +3434,7 @@ parse_partial_symbols (struct objfile *objfile)
 	  for (cur_sdx = 0; cur_sdx < fh->csym;)
 	    {
 	      char *name;
-	      enum address_class class;
+	      enum address_class addr_class;
 
 	      (*swap_sym_in) (cur_bfd,
 			      ((char *) debug_info->external_sym
@@ -3587,7 +3587,7 @@ parse_partial_symbols (struct objfile *objfile)
 							 mst_file_bss,
 							 SECT_OFF_BSS (objfile),
 							 objfile);
-		  class = LOC_STATIC;
+		  addr_class = LOC_STATIC;
 		  break;
 
 		case stIndirect:	/* Irix5 forward declaration */
@@ -3599,11 +3599,11 @@ parse_partial_symbols (struct objfile *objfile)
 		     structs from alpha and mips cc.  */
 		  if (sh.iss == 0 || has_opaque_xref (fh, &sh))
 		    goto skip;
-		  class = LOC_TYPEDEF;
+		  addr_class = LOC_TYPEDEF;
 		  break;
 
 		case stConstant:	/* Constant decl */
-		  class = LOC_CONST;
+		  addr_class = LOC_CONST;
 		  break;
 
 		case stUnion:
@@ -3659,7 +3659,7 @@ parse_partial_symbols (struct objfile *objfile)
 		}
 	      /* Use this gdb symbol.  */
 	      add_psymbol_to_list (name, strlen (name), 1,
-				   VAR_DOMAIN, class,
+				   VAR_DOMAIN, addr_class,
 				   &objfile->static_psymbols,
 				   0, sh.value, psymtab_language, objfile);
 	    skip:
@@ -3673,7 +3673,7 @@ parse_partial_symbols (struct objfile *objfile)
 	  PST_PRIVATE (save_pst)->extern_tab = ext_ptr;
 	  for (; --cur_sdx >= 0; ext_ptr++)
 	    {
-	      enum address_class class;
+	      enum address_class addr_class;
 	      SYMR *psh;
 	      char *name;
 	      CORE_ADDR svalue;
@@ -3723,7 +3723,7 @@ parse_partial_symbols (struct objfile *objfile)
 		     Ignore them, as parse_external will ignore them too.  */
 		  continue;
 		case stLabel:
-		  class = LOC_LABEL;
+		  addr_class = LOC_LABEL;
 		  break;
 		default:
 		  unknown_ext_complaint (debug_info->ssext + psh->iss);
@@ -3734,12 +3734,12 @@ parse_partial_symbols (struct objfile *objfile)
 		  if (SC_IS_COMMON (psh->sc))
 		    continue;
 
-		  class = LOC_STATIC;
+		  addr_class = LOC_STATIC;
 		  break;
 		}
 	      name = debug_info->ssext + psh->iss;
 	      add_psymbol_to_list (name, strlen (name), 1,
-				   VAR_DOMAIN, class,
+				   VAR_DOMAIN, addr_class,
 				   &objfile->global_psymbols,
 				   0, svalue,
 				   psymtab_language, objfile);
@@ -4585,7 +4585,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
 
 static struct symbol *
 mylookup_symbol (char *name, struct block *block,
-		 domain_enum domain, enum address_class class)
+		 domain_enum domain, enum address_class addr_class)
 {
   struct block_iterator iter;
   int inc;
@@ -4596,14 +4596,14 @@ mylookup_symbol (char *name, struct block *block,
     {
       if (SYMBOL_LINKAGE_NAME (sym)[0] == inc
 	  && SYMBOL_DOMAIN (sym) == domain
-	  && SYMBOL_CLASS (sym) == class
+	  && SYMBOL_CLASS (sym) == addr_class
 	  && strcmp (SYMBOL_LINKAGE_NAME (sym), name) == 0)
 	return sym;
     }
 
   block = BLOCK_SUPERBLOCK (block);
   if (block)
-    return mylookup_symbol (name, block, domain, class);
+    return mylookup_symbol (name, block, domain, addr_class);
   return 0;
 }
 
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index bcce435..8f0f858 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -67,7 +67,7 @@ struct objc_class {
 
 struct objc_super {
   CORE_ADDR receiver;
-  CORE_ADDR class;
+  CORE_ADDR objc_class;
 };
 
 struct objc_method {
@@ -854,7 +854,7 @@ parse_selector (char *method, char **selector)
 }
 
 static char * 
-parse_method (char *method, char *type, char **class, 
+parse_method (char *method, char *type, char **objc_class,
 	      char **category, char **selector)
 {
   char *s1 = NULL;
@@ -867,7 +867,7 @@ parse_method (char *method, char *type, char **class,
   char *nselector = NULL;
 
   gdb_assert (type != NULL);
-  gdb_assert (class != NULL);
+  gdb_assert (objc_class != NULL);
   gdb_assert (category != NULL);
   gdb_assert (selector != NULL);
   
@@ -939,8 +939,8 @@ parse_method (char *method, char *type, char **class,
 
   if (type != NULL)
     *type = ntype;
-  if (class != NULL)
-    *class = nclass;
+  if (objc_class != NULL)
+    *objc_class = nclass;
   if (category != NULL)
     *category = ncategory;
   if (selector != NULL)
@@ -950,7 +950,7 @@ parse_method (char *method, char *type, char **class,
 }
 
 static void
-find_methods (char type, const char *class, const char *category, 
+find_methods (char type, const char *objc_class, const char *category,
 	      const char *selector,
 	      VEC (const_char_ptr) **symbol_names)
 {
@@ -1016,8 +1016,8 @@ find_methods (char type, const char *class, const char *category,
 	  if ((type != '\0') && (ntype != type))
 	    continue;
 
-	  if ((class != NULL) 
-	      && ((nclass == NULL) || (strcmp (class, nclass) != 0)))
+	  if ((objc_class != NULL)
+	      && ((nclass == NULL) || (strcmp (objc_class, nclass) != 0)))
 	    continue;
 
 	  if ((category != NULL) && 
@@ -1105,7 +1105,7 @@ const char *
 find_imps (const char *method, VEC (const_char_ptr) **symbol_names)
 {
   char type = '\0';
-  char *class = NULL;
+  char *objc_class = NULL;
   char *category = NULL;
   char *selector = NULL;
 
@@ -1118,7 +1118,7 @@ find_imps (const char *method, VEC (const_char_ptr) **symbol_names)
 
   buf = (char *) alloca (strlen (method) + 1);
   strcpy (buf, method);
-  tmp = parse_method (buf, &type, &class, &category, &selector);
+  tmp = parse_method (buf, &type, &objc_class, &category, &selector);
 
   if (tmp == NULL)
     {
@@ -1131,7 +1131,7 @@ find_imps (const char *method, VEC (const_char_ptr) **symbol_names)
       selector_case = 1;
     }
 
-  find_methods (type, class, category, selector, symbol_names);
+  find_methods (type, objc_class, category, selector, symbol_names);
 
   /* If we hit the "selector" case, and we found some methods, then
      add the selector itself as a symbol, if it exists.  */
@@ -1411,34 +1411,36 @@ read_objc_super (struct gdbarch *gdbarch, CORE_ADDR addr,
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   super->receiver = read_memory_unsigned_integer (addr, 4, byte_order);
-  super->class = read_memory_unsigned_integer (addr + 4, 4, byte_order);
+  super->objc_class = read_memory_unsigned_integer (addr + 4, 4, byte_order);
 };
 
 static void 
 read_objc_class (struct gdbarch *gdbarch, CORE_ADDR addr,
-		 struct objc_class *class)
+		 struct objc_class *objc_class)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
-  class->isa = read_memory_unsigned_integer (addr, 4, byte_order);
-  class->super_class = read_memory_unsigned_integer (addr + 4, 4, byte_order);
-  class->name = read_memory_unsigned_integer (addr + 8, 4, byte_order);
-  class->version = read_memory_unsigned_integer (addr + 12, 4, byte_order);
-  class->info = read_memory_unsigned_integer (addr + 16, 4, byte_order);
-  class->instance_size = read_memory_unsigned_integer (addr + 18, 4,
+  objc_class->isa = read_memory_unsigned_integer (addr, 4, byte_order);
+  objc_class->super_class = read_memory_unsigned_integer (addr + 4, 4,
+						       byte_order);
+  objc_class->name = read_memory_unsigned_integer (addr + 8, 4, byte_order);
+  objc_class->version = read_memory_unsigned_integer (addr + 12, 4, byte_order);
+  objc_class->info = read_memory_unsigned_integer (addr + 16, 4, byte_order);
+  objc_class->instance_size = read_memory_unsigned_integer (addr + 18, 4,
+						       byte_order);
+  objc_class->ivars = read_memory_unsigned_integer (addr + 24, 4, byte_order);
+  objc_class->methods = read_memory_unsigned_integer (addr + 28, 4, byte_order);
+  objc_class->cache = read_memory_unsigned_integer (addr + 32, 4, byte_order);
+  objc_class->protocols = read_memory_unsigned_integer (addr + 36, 4,
 						       byte_order);
-  class->ivars = read_memory_unsigned_integer (addr + 24, 4, byte_order);
-  class->methods = read_memory_unsigned_integer (addr + 28, 4, byte_order);
-  class->cache = read_memory_unsigned_integer (addr + 32, 4, byte_order);
-  class->protocols = read_memory_unsigned_integer (addr + 36, 4, byte_order);
 }
 
 static CORE_ADDR
 find_implementation_from_class (struct gdbarch *gdbarch,
-				CORE_ADDR class, CORE_ADDR sel)
+				CORE_ADDR objc_class, CORE_ADDR sel)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  CORE_ADDR subclass = class;
+  CORE_ADDR subclass = objc_class;
 
   while (subclass != 0) 
     {
@@ -1562,10 +1564,10 @@ resolve_msgsend_super (CORE_ADDR pc, CORE_ADDR *new_pc)
   sel = gdbarch_fetch_pointer_argument (gdbarch, frame, 1, ptr_type);
 
   read_objc_super (gdbarch, super, &sstr);
-  if (sstr.class == 0)
+  if (sstr.objc_class == 0)
     return 0;
   
-  res = find_implementation_from_class (gdbarch, sstr.class, sel);
+  res = find_implementation_from_class (gdbarch, sstr.objc_class, sel);
   if (new_pc != 0)
     *new_pc = res;
   if (res == 0)
@@ -1590,10 +1592,10 @@ resolve_msgsend_super_stret (CORE_ADDR pc, CORE_ADDR *new_pc)
   sel = gdbarch_fetch_pointer_argument (gdbarch, frame, 2, ptr_type);
 
   read_objc_super (gdbarch, super, &sstr);
-  if (sstr.class == 0)
+  if (sstr.objc_class == 0)
     return 0;
   
-  res = find_implementation_from_class (gdbarch, sstr.class, sel);
+  res = find_implementation_from_class (gdbarch, sstr.objc_class, sel);
   if (new_pc != 0)
     *new_pc = res;
   if (res == 0)
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index ed022ad..55eecf1 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -105,7 +105,7 @@ struct objc_class_str
   {
     struct stoken stoken;
     struct type *type;
-    int class;
+    int objc_class;
   };
 
 typedef struct type *type_ptr;
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 8eac5e1..d9dc3e9 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1496,12 +1496,12 @@ psymbol_hash (const void *addr, int length)
   struct partial_symbol *psymbol = (struct partial_symbol *) addr;
   unsigned int lang = psymbol->ginfo.language;
   unsigned int domain = PSYMBOL_DOMAIN (psymbol);
-  unsigned int class = PSYMBOL_CLASS (psymbol);
+  unsigned int addr_class = PSYMBOL_CLASS (psymbol);
 
   h = hash_continue (&psymbol->ginfo.value, sizeof (psymbol->ginfo.value), h);
   h = hash_continue (&lang, sizeof (unsigned int), h);
   h = hash_continue (&domain, sizeof (unsigned int), h);
-  h = hash_continue (&class, sizeof (unsigned int), h);
+  h = hash_continue (&addr_class, sizeof (unsigned int), h);
   h = hash_continue (psymbol->ginfo.name, strlen (psymbol->ginfo.name), h);
 
   return h;
@@ -1579,7 +1579,7 @@ psymbol_bcache_full (struct partial_symbol *sym,
 static const struct partial_symbol *
 add_psymbol_to_bcache (const char *name, int namelength, int copy_name,
 		       domain_enum domain,
-		       enum address_class class,
+		       enum address_class addr_class,
 		       long val,	/* Value as a long */
 		       CORE_ADDR coreaddr,	/* Value as a CORE_ADDR */
 		       enum language language, struct objfile *objfile,
@@ -1604,7 +1604,7 @@ add_psymbol_to_bcache (const char *name, int namelength, int copy_name,
   SYMBOL_SECTION (&psymbol) = -1;
   SYMBOL_SET_LANGUAGE (&psymbol, language, &objfile->objfile_obstack);
   PSYMBOL_DOMAIN (&psymbol) = domain;
-  PSYMBOL_CLASS (&psymbol) = class;
+  PSYMBOL_CLASS (&psymbol) = addr_class;
 
   SYMBOL_SET_NAMES (&psymbol, name, namelength, copy_name, objfile);
 
@@ -1664,7 +1664,7 @@ append_psymbol_to_list (struct psymbol_allocation_list *list,
 void
 add_psymbol_to_list (const char *name, int namelength, int copy_name,
 		     domain_enum domain,
-		     enum address_class class,
+		     enum address_class addr_class,
 		     struct psymbol_allocation_list *list, 
 		     long val,	/* Value as a long */
 		     CORE_ADDR coreaddr,	/* Value as a CORE_ADDR */
@@ -1675,7 +1675,7 @@ add_psymbol_to_list (const char *name, int namelength, int copy_name,
   int added;
 
   /* Stash the partial symbol away in the cache.  */
-  psym = add_psymbol_to_bcache (name, namelength, copy_name, domain, class,
+  psym = add_psymbol_to_bcache (name, namelength, copy_name, domain, addr_class,
 				val, coreaddr, language, objfile, &added);
 
   /* Do not duplicate global partial symbols.  */
diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index 8afe52d..5877bf6 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -145,42 +145,45 @@ static PyObject *
 sympy_is_constant (PyObject *self, void *closure)
 {
   struct symbol *symbol = NULL;
-  enum address_class class;
+  enum address_class addr_class;
 
   SYMPY_REQUIRE_VALID (self, symbol);
 
-  class = SYMBOL_CLASS (symbol);
+  addr_class = SYMBOL_CLASS (symbol);
 
-  return PyBool_FromLong (class == LOC_CONST || class == LOC_CONST_BYTES);
+  return PyBool_FromLong (addr_class == LOC_CONST
+			  || addr_class == LOC_CONST_BYTES);
 }
 
 static PyObject *
 sympy_is_function (PyObject *self, void *closure)
 {
   struct symbol *symbol = NULL;
-  enum address_class class;
+  enum address_class addr_class;
 
   SYMPY_REQUIRE_VALID (self, symbol);
 
-  class = SYMBOL_CLASS (symbol);
+  addr_class = SYMBOL_CLASS (symbol);
 
-  return PyBool_FromLong (class == LOC_BLOCK);
+  return PyBool_FromLong (addr_class == LOC_BLOCK);
 }
 
 static PyObject *
 sympy_is_variable (PyObject *self, void *closure)
 {
   struct symbol *symbol = NULL;
-  enum address_class class;
+  enum address_class addr_class;
 
   SYMPY_REQUIRE_VALID (self, symbol);
 
-  class = SYMBOL_CLASS (symbol);
+  addr_class = SYMBOL_CLASS (symbol);
 
   return PyBool_FromLong (!SYMBOL_IS_ARGUMENT (symbol)
-			  && (class == LOC_LOCAL || class == LOC_REGISTER
-			      || class == LOC_STATIC || class == LOC_COMPUTED
-			      || class == LOC_OPTIMIZED_OUT));
+			  && (addr_class == LOC_LOCAL
+			      || addr_class == LOC_REGISTER
+			      || addr_class == LOC_STATIC
+			      || addr_class == LOC_COMPUTED
+			      || addr_class == LOC_OPTIMIZED_OUT));
 }
 
 /* Implementation of gdb.Symbol.needs_frame -> Boolean.
diff --git a/gdb/top.c b/gdb/top.c
index c473d8c..8b360ee 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -453,7 +453,7 @@ execute_command (char *p, int from_tty)
 	deprecated_cmd_warning (line);
 
       /* c->user_commands would be NULL in the case of a python command.  */
-      if (c->class == class_user && c->user_commands)
+      if (c->cmd_class == class_user && c->user_commands)
 	execute_user_command (c, arg);
       else if (c->type == set_cmd)
 	do_set_command (arg, from_tty, c);
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 18/18] un-nest enum pvk
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (5 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 11/18] poison "template" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 07/18] poison "explicit" Ondrej Oprala
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog:

2013-10-09  Tom Tromey  <tromey@redhat.com>

	* prologue-value.h (enum pvk): Moved out from ...
	(struct prologue_value): ... here.
---
 gdb/prologue-value.h | 44 +++++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/gdb/prologue-value.h b/gdb/prologue-value.h
index b8ed813..af7728e 100644
--- a/gdb/prologue-value.h
+++ b/gdb/prologue-value.h
@@ -19,6 +19,28 @@
 #ifndef PROLOGUE_VALUE_H
 #define PROLOGUE_VALUE_H
 
+/* What sort of value is this?  This determines the interpretation
+   of subsequent fields.  */
+enum pvk {
+
+  /* We don't know anything about the value.  This is also used for
+     values we could have kept track of, when doing so would have
+     been too complex and we don't want to bother.  The bottom of
+     our lattice.  */
+  pvk_unknown,
+
+  /* A known constant.  K is its value.  */
+  pvk_constant,
+
+  /* The value that register REG originally had *UPON ENTRY TO THE
+     FUNCTION*, plus K.  If K is zero, this means, obviously, just
+     the value REG had upon entry to the function.  REG is a GDB
+     register number.  Before we start interpreting, we initialize
+     every register R to { pvk_register, R, 0 }.  */
+  pvk_register,
+
+};
+
 /* When we analyze a prologue, we're really doing 'abstract
    interpretation' or 'pseudo-evaluation': running the function's code
    in simulation, but using conservative approximations of the values
@@ -118,27 +140,7 @@
 
 struct prologue_value {
 
-  /* What sort of value is this?  This determines the interpretation
-     of subsequent fields.  */
-  enum {
-
-    /* We don't know anything about the value.  This is also used for
-       values we could have kept track of, when doing so would have
-       been too complex and we don't want to bother.  The bottom of
-       our lattice.  */
-    pvk_unknown,
-
-    /* A known constant.  K is its value.  */
-    pvk_constant,
-
-    /* The value that register REG originally had *UPON ENTRY TO THE
-       FUNCTION*, plus K.  If K is zero, this means, obviously, just
-       the value REG had upon entry to the function.  REG is a GDB
-       register number.  Before we start interpreting, we initialize
-       every register R to { pvk_register, R, 0 }.  */
-    pvk_register,
-
-  } kind;
+  enum pvk kind;
 
   /* The meanings of the following fields depend on 'kind'; see the
      comments for the specific 'kind' values.  */
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 10/18] poison "operator"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (9 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 02/18] poison "new" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 12/18] poison "try" Ondrej Oprala
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* c-exp.y (oper): Renamed from operator.
	* f-exp.y (oper): Likewise.
	* go-exp.y (oper): Likewise.
	* jv-exp.y (oper): Likewise.
	* p-exp.y (oper): Likewise.
	* valarith.c (oper): Likewise.
---
 gdb/c-exp.y    |  8 ++++----
 gdb/f-exp.y    | 18 +++++++++---------
 gdb/go-exp.y   |  8 ++++----
 gdb/jv-exp.y   |  6 +++---
 gdb/p-exp.y    | 10 +++++-----
 gdb/valarith.c |  6 +++---
 6 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index a796dbb..6d50c0c 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -2223,7 +2223,7 @@ enum token_flags
 
 struct token
 {
-  char *operator;
+  char *oper;
   int token;
   enum exp_opcode opcode;
   enum token_flags flags;
@@ -2444,7 +2444,7 @@ lex_one_token (void)
   tokstart = lexptr;
   /* See if it is a special token of length 3.  */
   for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
-    if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
+    if (strncmp (tokstart, tokentab3[i].oper, 3) == 0)
       {
 	if ((tokentab3[i].flags & FLAG_CXX) != 0
 	    && parse_language->la_language != language_cplus)
@@ -2457,7 +2457,7 @@ lex_one_token (void)
 
   /* See if it is a special token of length 2.  */
   for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
-    if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
+    if (strncmp (tokstart, tokentab2[i].oper, 2) == 0)
       {
 	if ((tokentab2[i].flags & FLAG_CXX) != 0
 	    && parse_language->la_language != language_cplus)
@@ -2751,7 +2751,7 @@ lex_one_token (void)
   /* Catch specific keywords.  */
   copy = copy_name (yylval.sval);
   for (i = 0; i < sizeof ident_tokens / sizeof ident_tokens[0]; i++)
-    if (strcmp (copy, ident_tokens[i].operator) == 0)
+    if (strcmp (copy, ident_tokens[i].oper) == 0)
       {
 	if ((ident_tokens[i].flags & FLAG_CXX) != 0
 	    && parse_language->la_language != language_cplus)
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 59c5e6c..fcaccdf 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -806,7 +806,7 @@ parse_number (const char *p, int len, int parsed_float, YYSTYPE *putithere)
 
 struct token
 {
-  char *operator;
+  char *oper;
   int token;
   enum exp_opcode opcode;
 };
@@ -982,11 +982,11 @@ yylex (void)
   
   /* See if it is a special .foo. operator.  */
   
-  for (i = 0; dot_ops[i].operator != NULL; i++)
-    if (strncmp (tokstart, dot_ops[i].operator,
-		 strlen (dot_ops[i].operator)) == 0)
+  for (i = 0; dot_ops[i].oper != NULL; i++)
+    if (strncmp (tokstart, dot_ops[i].oper,
+		 strlen (dot_ops[i].oper)) == 0)
       {
-	lexptr += strlen (dot_ops[i].operator);
+	lexptr += strlen (dot_ops[i].oper);
 	yylval.opcode = dot_ops[i].opcode;
 	return dot_ops[i].token;
       }
@@ -1150,11 +1150,11 @@ yylex (void)
   
   /* Catch specific keywords.  */
   
-  for (i = 0; f77_keywords[i].operator != NULL; i++)
-    if (strlen (f77_keywords[i].operator) == namelen
-	&& strncmp (tokstart, f77_keywords[i].operator, namelen) == 0)
+  for (i = 0; f77_keywords[i].oper != NULL; i++)
+    if (strlen (f77_keywords[i].oper) == namelen
+	&& strncmp (tokstart, f77_keywords[i].oper, namelen) == 0)
       {
-	/* 	lexptr += strlen(f77_keywords[i].operator); */ 
+	/* 	lexptr += strlen(f77_keywords[i].oper); */
 	yylval.opcode = f77_keywords[i].opcode;
 	return f77_keywords[i].token;
       }
diff --git a/gdb/go-exp.y b/gdb/go-exp.y
index 01c382a..412de64 100644
--- a/gdb/go-exp.y
+++ b/gdb/go-exp.y
@@ -975,7 +975,7 @@ parse_string_or_char (const char *tokptr, const char **outptr,
 
 struct token
 {
-  char *operator;
+  char *oper;
   int token;
   enum exp_opcode opcode;
 };
@@ -1062,7 +1062,7 @@ lex_one_token (void)
   tokstart = lexptr;
   /* See if it is a special token of length 3.  */
   for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
-    if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
+    if (strncmp (tokstart, tokentab3[i].oper, 3) == 0)
       {
 	lexptr += 3;
 	yylval.opcode = tokentab3[i].opcode;
@@ -1071,7 +1071,7 @@ lex_one_token (void)
 
   /* See if it is a special token of length 2.  */
   for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
-    if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
+    if (strncmp (tokstart, tokentab2[i].oper, 2) == 0)
       {
 	lexptr += 2;
 	yylval.opcode = tokentab2[i].opcode;
@@ -1301,7 +1301,7 @@ lex_one_token (void)
   /* Catch specific keywords.  */
   copy = copy_name (yylval.sval);
   for (i = 0; i < sizeof (ident_tokens) / sizeof (ident_tokens[0]); i++)
-    if (strcmp (copy, ident_tokens[i].operator) == 0)
+    if (strcmp (copy, ident_tokens[i].oper) == 0)
       {
 	/* It is ok to always set this, even though we don't always
 	   strictly need to.  */
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y
index e4b1cec..5e4503e 100644
--- a/gdb/jv-exp.y
+++ b/gdb/jv-exp.y
@@ -821,7 +821,7 @@ parse_number (const char *p, int len, int parsed_float, YYSTYPE *putithere)
 
 struct token
 {
-  char *operator;
+  char *oper;
   int token;
   enum exp_opcode opcode;
 };
@@ -875,7 +875,7 @@ yylex (void)
   tokstart = lexptr;
   /* See if it is a special token of length 3.  */
   for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
-    if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
+    if (strncmp (tokstart, tokentab3[i].oper, 3) == 0)
       {
 	lexptr += 3;
 	yylval.opcode = tokentab3[i].opcode;
@@ -884,7 +884,7 @@ yylex (void)
 
   /* See if it is a special token of length 2.  */
   for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
-    if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
+    if (strncmp (tokstart, tokentab2[i].oper, 2) == 0)
       {
 	lexptr += 2;
 	yylval.opcode = tokentab2[i].opcode;
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index de14cbb..41207ed 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -1075,7 +1075,7 @@ pop_current_type (void)
 
 struct token
 {
-  char *operator;
+  char *oper;
   int token;
   enum exp_opcode opcode;
 };
@@ -1153,8 +1153,8 @@ yylex (void)
   /* See if it is a special token of length 3.  */
   if (explen > 2)
     for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
-      if (strncasecmp (tokstart, tokentab3[i].operator, 3) == 0
-          && (!isalpha (tokentab3[i].operator[0]) || explen == 3
+      if (strncasecmp (tokstart, tokentab3[i].oper, 3) == 0
+          && (!isalpha (tokentab3[i].oper[0]) || explen == 3
               || (!isalpha (tokstart[3])
 		  && !isdigit (tokstart[3]) && tokstart[3] != '_')))
         {
@@ -1166,8 +1166,8 @@ yylex (void)
   /* See if it is a special token of length 2.  */
   if (explen > 1)
   for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
-      if (strncasecmp (tokstart, tokentab2[i].operator, 2) == 0
-          && (!isalpha (tokentab2[i].operator[0]) || explen == 2
+      if (strncasecmp (tokstart, tokentab2[i].oper, 2) == 0
+          && (!isalpha (tokentab2[i].oper[0]) || explen == 2
               || (!isalpha (tokstart[2])
 		  && !isdigit (tokstart[2]) && tokstart[2] != '_')))
         {
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 18c14fc..b50bd21 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -286,14 +286,14 @@ unop_user_defined_p (enum exp_opcode op, struct value *arg1)
    situations or combinations thereof.  */
 
 static struct value *
-value_user_defined_cpp_op (struct value **args, int nargs, char *operator,
+value_user_defined_cpp_op (struct value **args, int nargs, char *oper,
                            int *static_memfuncp)
 {
 
   struct symbol *symp = NULL;
   struct value *valp = NULL;
 
-  find_overload_match (args, nargs, operator, BOTH /* could be method */,
+  find_overload_match (args, nargs, oper, BOTH /* could be method */,
                        &args[0] /* objp */,
                        NULL /* pass NULL symbol since symbol is unknown */,
                        &valp, &symp, static_memfuncp, 0);
@@ -310,7 +310,7 @@ value_user_defined_cpp_op (struct value **args, int nargs, char *operator,
       return value_of_variable (symp, 0);
     }
 
-  error (_("Could not find %s."), operator);
+  error (_("Could not find %s."), oper);
 }
 
 /* Lookup user defined operator NAME.  Return a value representing the
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 05/18] poison "private"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (7 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 07/18] poison "explicit" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 02/18] poison "new" Ondrej Oprala
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* gdbthread.h (struct thread_info): Rename field private to
	private_data.
	* inferior.c (struct inferior): Likewise.
	* inferior.h (private_data): Renamed from private.
	* jit.c (private_unwind): Likewise.
	* linux-thread-db.c (thread): Rename field private to
	private_data.
	(private_thr): Renamed from private.
	* nto-tdep.c (struct thread_info): Rename field private to
	private_data.
	* remote.c (struct thread_info): Likewise.
	* thread.c (struct thread_info): Likewise.
---
 gdb/gdbthread.h       |  6 +++---
 gdb/inferior.c        |  2 +-
 gdb/inferior.h        |  2 +-
 gdb/jit.c             |  8 ++++----
 gdb/linux-thread-db.c | 42 +++++++++++++++++++++---------------------
 gdb/nto-tdep.c        |  6 +++---
 gdb/remote.c          | 18 +++++++++---------
 gdb/thread.c          | 10 +++++-----
 8 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 81dc7ed..eb4bac7 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -230,10 +230,10 @@ struct thread_info
   struct frame_id initiating_frame;
 
   /* Private data used by the target vector implementation.  */
-  struct private_thread_info *private;
+  struct private_thread_info *private_data;
 
-  /* Function that is called to free PRIVATE.  If this is NULL, then
-     xfree will be called on PRIVATE.  */
+  /* Function that is called to free PRIVATE_DATA.  If this is NULL, then
+     xfree will be called on PRIVATE_DATA.  */
   void (*private_dtor) (struct private_thread_info *);
 
   /* Branch trace information for this thread.  */
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 28a5200..57004b2 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -102,7 +102,7 @@ free_inferior (struct inferior *inf)
   xfree (inf->terminal);
   free_environ (inf->environment);
   target_desc_info_free (inf->tdesc_info);
-  xfree (inf->private);
+  xfree (inf->private_data);
   xfree (inf);
 }
 
diff --git a/gdb/inferior.h b/gdb/inferior.h
index fff072b..7c5e1ea 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -486,7 +486,7 @@ struct inferior
   struct continuation *continuations;
 
   /* Private data used by the target vector implementation.  */
-  struct private_inferior *private;
+  struct private_inferior *private_data;
 
   /* HAS_EXIT_CODE is true if the inferior exited with an exit code.
      In this case, the EXIT_CODE field is also valid.  */
diff --git a/gdb/jit.c b/gdb/jit.c
index 4eb818c..2048391 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -1216,20 +1216,20 @@ static void
 jit_frame_this_id (struct frame_info *this_frame, void **cache,
                    struct frame_id *this_id)
 {
-  struct jit_unwind_private private;
+  struct jit_unwind_private private_unwind;
   struct gdb_frame_id frame_id;
   struct gdb_reader_funcs *funcs;
   struct gdb_unwind_callbacks callbacks;
 
-  private.registers = NULL;
-  private.this_frame = this_frame;
+  private_unwind.registers = NULL;
+  private_unwind.this_frame = this_frame;
 
   /* We don't expect the frame_id function to set any registers, so we
      set reg_set to NULL.  */
   callbacks.reg_get = jit_unwind_reg_get_impl;
   callbacks.reg_set = NULL;
   callbacks.target_read = jit_target_read_impl;
-  callbacks.priv_data = &private;
+  callbacks.priv_data = &private_unwind;
 
   gdb_assert (loaded_jit_reader);
   funcs = loaded_jit_reader->functions;
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 593fc29..960e07d 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -375,7 +375,7 @@ have_threads_callback (struct thread_info *thread, void *args)
   if (ptid_get_pid (thread->ptid) != pid)
     return 0;
 
-  return thread->private != NULL;
+  return thread->private_data != NULL;
 }
 
 static int
@@ -1224,7 +1224,7 @@ static int
 attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
 	       const td_thrinfo_t *ti_p)
 {
-  struct private_thread_info *private;
+  struct private_thread_info *private_thr;
   struct thread_info *tp;
   td_err_e err;
   struct thread_db_info *info;
@@ -1249,9 +1249,9 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
 	 PTRACE_EVENT_CLONE); assume the same mechanism notices thread
 	 exit, so this can not be a stale thread recreated with the
 	 same ID.  */
-      if (tp->private != NULL)
+      if (tp->private_data != NULL)
 	{
-	  if (!tp->private->dying)
+	  if (!tp->private_data->dying)
 	    return 0;
 
 	  delete_thread (ptid);
@@ -1286,8 +1286,8 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
     }
 
   /* Construct the thread's private data.  */
-  private = xmalloc (sizeof (struct private_thread_info));
-  memset (private, 0, sizeof (struct private_thread_info));
+  private_thr = xmalloc (sizeof (struct private_thread_info));
+  memset (private_thr, 0, sizeof (struct private_thread_info));
 
   /* A thread ID of zero may mean the thread library has not initialized
      yet.  But we shouldn't even get here if that's the case.  FIXME:
@@ -1295,16 +1295,16 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
      list this will have to go somewhere else; maybe private == NULL
      until the thread_db target claims it.  */
   gdb_assert (ti_p->ti_tid != 0);
-  private->th = *th_p;
-  private->tid = ti_p->ti_tid;
+  private_thr->th = *th_p;
+  private_thr->tid = ti_p->ti_tid;
   if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
-    private->dying = 1;
+    private_thr->dying = 1;
 
   /* Add the thread to GDB's thread list.  */
   if (tp == NULL)
-    add_thread_with_info (ptid, private);
+    add_thread_with_info (ptid, private_thr);
   else
-    tp->private = private;
+    tp->private_data = private_thr;
 
   info = get_thread_db_info (ptid_get_pid (ptid));
 
@@ -1335,8 +1335,8 @@ detach_thread (ptid_t ptid)
      something re-uses its thread ID.  We'll report the thread exit
      when the underlying LWP dies.  */
   thread_info = find_thread_ptid (ptid);
-  gdb_assert (thread_info != NULL && thread_info->private != NULL);
-  thread_info->private->dying = 1;
+  gdb_assert (thread_info != NULL && thread_info->private_data != NULL);
+  thread_info->private_data->dying = 1;
 }
 
 static void
@@ -1598,7 +1598,7 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
 
   ptid = ptid_build (info->pid, ti.ti_lid, 0);
   tp = find_thread_ptid (ptid);
-  if (tp == NULL || tp->private == NULL)
+  if (tp == NULL || tp->private_data == NULL)
     {
       if (attach_thread (ptid, th_p, &ti))
 	cb_data->new_threads += 1;
@@ -1741,12 +1741,12 @@ thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid)
   struct thread_info *thread_info = find_thread_ptid (ptid);
   struct target_ops *beneath;
 
-  if (thread_info != NULL && thread_info->private != NULL)
+  if (thread_info != NULL && thread_info->private_data != NULL)
     {
       static char buf[64];
       thread_t tid;
 
-      tid = thread_info->private->tid;
+      tid = thread_info->private_data->tid;
       snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)",
 		tid, ptid_get_lwp (ptid));
 
@@ -1766,10 +1766,10 @@ thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid)
 static char *
 thread_db_extra_thread_info (struct thread_info *info)
 {
-  if (info->private == NULL)
+  if (info->private_data == NULL)
     return NULL;
 
-  if (info->private->dying)
+  if (info->private_data->dying)
     return "Exiting";
 
   return NULL;
@@ -1794,7 +1794,7 @@ thread_db_get_thread_local_address (struct target_ops *ops,
   /* Find the matching thread.  */
   thread_info = find_thread_ptid (ptid);
 
-  if (thread_info != NULL && thread_info->private != NULL)
+  if (thread_info != NULL && thread_info->private_data != NULL)
     {
       td_err_e err;
       psaddr_t address;
@@ -1814,7 +1814,7 @@ thread_db_get_thread_local_address (struct target_ops *ops,
       /* Note the cast through uintptr_t: this interface only works if
 	 a target address fits in a psaddr_t, which is a host pointer.
 	 So a 32-bit debugger can not access 64-bit TLS through this.  */
-      err = info->td_thr_tls_get_addr_p (&thread_info->private->th,
+      err = info->td_thr_tls_get_addr_p (&thread_info->private_data->th,
 					 (psaddr_t)(uintptr_t) lm,
 					 offset, &address);
 
@@ -1857,7 +1857,7 @@ thread_db_find_thread_from_tid (struct thread_info *thread, void *data)
 {
   long *tid = (long *) data;
 
-  if (thread->private->tid == *tid)
+  if (thread->private_data->tid == *tid)
     return 1;
 
   return 0;
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 5ec746d..117443c 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -366,9 +366,9 @@ static const char *nto_thread_state_str[] =
 char *
 nto_extra_thread_info (struct thread_info *ti)
 {
-  if (ti && ti->private
-      && ti->private->state < ARRAY_SIZE (nto_thread_state_str))
-    return (char *)nto_thread_state_str [ti->private->state];
+  if (ti && ti->private_data
+      && ti->private_data->state < ARRAY_SIZE (nto_thread_state_str))
+    return (char *)nto_thread_state_str [ti->private_data->state];
   return "";
 }
 
diff --git a/gdb/remote.c b/gdb/remote.c
index a2e8a01..34c7edf 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1657,15 +1657,15 @@ demand_private_info (ptid_t ptid)
 
   gdb_assert (info);
 
-  if (!info->private)
+  if (!info->private_data)
     {
-      info->private = xmalloc (sizeof (*(info->private)));
+      info->private_data = xmalloc (sizeof (*(info->private_data)));
       info->private_dtor = free_private_thread_info;
-      info->private->core = -1;
-      info->private->extra = 0;
+      info->private_data->core = -1;
+      info->private_data->extra = 0;
     }
 
-  return info->private;
+  return info->private_data;
 }
 
 /* Call this function as a result of
@@ -2885,8 +2885,8 @@ remote_threads_extra_info (struct thread_info *tp)
     {
       struct thread_info *info = find_thread_ptid (tp->ptid);
 
-      if (info && info->private)
-	return info->private->extra;
+      if (info && info->private_data)
+	return info->private_data->extra;
       else
 	return NULL;
     }
@@ -11122,8 +11122,8 @@ remote_core_of_thread (struct target_ops *ops, ptid_t ptid)
 {
   struct thread_info *info = find_thread_ptid (ptid);
 
-  if (info && info->private)
-    return info->private->core;
+  if (info && info->private_data)
+    return info->private_data->core;
   return -1;
 }
 
diff --git a/gdb/thread.c b/gdb/thread.c
index 64a57c5..aae8cfb 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -139,12 +139,12 @@ clear_thread_inferior_resources (struct thread_info *tp)
 static void
 free_thread (struct thread_info *tp)
 {
-  if (tp->private)
+  if (tp->private_data)
     {
       if (tp->private_dtor)
-	tp->private_dtor (tp->private);
+	tp->private_dtor (tp->private_data);
       else
-	xfree (tp->private);
+	xfree (tp->private_data);
     }
 
   xfree (tp->name);
@@ -244,11 +244,11 @@ add_thread_silent (ptid_t ptid)
 }
 
 struct thread_info *
-add_thread_with_info (ptid_t ptid, struct private_thread_info *private)
+add_thread_with_info (ptid_t ptid, struct private_thread_info *private_data)
 {
   struct thread_info *result = add_thread_silent (ptid);
 
-  result->private = private;
+  result->private_data = private_data;
 
   if (print_thread_events)
     printf_unfiltered (_("[New %s]\n"), target_pid_to_str (ptid));
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 12/18] poison "try"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (10 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 10/18] poison "operator" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 03/18] poison "this" Ondrej Oprala
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* hppa-linux-tdep.c (attempt): Renamed from try.
	* i386-nat.c (attempt): Likewise.
	* remote-mips.c (attempt): Likewise.
---
 gdb/hppa-linux-tdep.c | 16 ++++++++--------
 gdb/i386-nat.c        |  4 ++--
 gdb/remote-mips.c     |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c
index 52efea1..0720a56 100644
--- a/gdb/hppa-linux-tdep.c
+++ b/gdb/hppa-linux-tdep.c
@@ -136,7 +136,7 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   unsigned int dummy[HPPA_MAX_INSN_PATTERN_LEN];
   int offs = 0;
-  int try;
+  int attempt;
   /* offsets to try to find the trampoline */
   static int pcoffs[] = { 0, 4*4, 5*4 };
   /* offsets to the rt_sigframe structure */
@@ -154,12 +154,12 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc)
      e4008200 be,l 0x100(%sr2, %r0), %sr0, %r31
      08000240 nop  */
 
-  for (try = 0; try < ARRAY_SIZE (pcoffs); try++)
+  for (attempt = 0; attempt < ARRAY_SIZE (pcoffs); attempt++)
     {
-      if (insns_match_pattern (gdbarch, sp + pcoffs[try],
+      if (insns_match_pattern (gdbarch, sp + pcoffs[attempt],
 			       hppa_sigtramp, dummy))
 	{
-          offs = sfoffs[try];
+          offs = sfoffs[attempt];
 	  break;
 	}
     }
@@ -171,8 +171,8 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc)
 	  /* sigaltstack case: we have no way of knowing which offset to 
 	     use in this case; default to new kernel handling.  If this is
 	     wrong the unwinding will fail.  */
-	  try = 2;
-	  sp = pc - pcoffs[try];
+	  attempt = 2;
+	  sp = pc - pcoffs[attempt];
 	}
       else
       {
@@ -180,13 +180,13 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc)
       }
     }
 
-  /* sp + sfoffs[try] points to a struct rt_sigframe, which contains
+  /* sp + sfoffs[attempt] points to a struct rt_sigframe, which contains
      a struct siginfo and a struct ucontext.  struct ucontext contains
      a struct sigcontext.  Return an offset to this sigcontext here.  Too 
      bad we cannot include system specific headers :-(.
      sizeof(struct siginfo) == 128
      offsetof(struct ucontext, uc_mcontext) == 24.  */
-  return sp + sfoffs[try] + 128 + 24;
+  return sp + sfoffs[attempt] + 128 + 24;
 }
 
 struct hppa_linux_sigtramp_unwind_cache
diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c
index 0a5deb0..6069350 100644
--- a/gdb/i386-nat.c
+++ b/gdb/i386-nat.c
@@ -524,8 +524,8 @@ i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state,
       int align = addr % max_wp_len;
       /* Four (eight on AMD64) is the maximum length a debug register
 	 can watch.  */
-      int try = (len > max_wp_len ? (max_wp_len - 1) : len - 1);
-      int size = size_try_array[try][align];
+      int attempt = (len > max_wp_len ? (max_wp_len - 1) : len - 1);
+      int size = size_try_array[attempt][align];
 
       if (what == WP_COUNT)
 	{
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index bf6cce5..423e8b1 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -857,7 +857,7 @@ mips_send_packet (const char *s, int get_ack)
   /* unsigned */ int len;
   unsigned char *packet;
   int cksum;
-  int try;
+  int attempt;
 
   len = strlen (s);
   if (len > DATA_MAXLEN)
@@ -884,7 +884,7 @@ mips_send_packet (const char *s, int get_ack)
   /* We can only have one outstanding data packet, so we just wait for
      the acknowledgement here.  Keep retransmitting the packet until
      we get one, or until we've tried too many times.  */
-  for (try = 0; try < mips_send_retries; try++)
+  for (attempt = 0; attempt < mips_send_retries; attempt++)
     {
       int garbage;
       int ch;
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 13/18] poison "typename"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 17/18] fix gdbarch buglet Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 15/18] fix up vec Ondrej Oprala
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* ada-lang.c (type_name): Renamed from typename.
	* break-catch-throw.c (type_name): Likewise.
	* cp-valprint.c (type_name): Likewise.
	* dwarf2read.c (type_name): Likewise.
	* gdbtypes.c (type_name): Likewise.
	* gnu-v3-abi.c (type_name): Likewise.
	* p-valprint.c (type_name): Likewise.
	* stabsread.c (type_name): Likewise.
	* typeprint.c (type_name): Likewise.
---
 gdb/ada-lang.c          |  8 ++++----
 gdb/break-catch-throw.c | 14 +++++++-------
 gdb/cp-valprint.c       |  4 ++--
 gdb/dwarf2read.c        | 10 +++++-----
 gdb/gdbtypes.c          | 20 ++++++++++----------
 gdb/gnu-v3-abi.c        | 26 +++++++++++++-------------
 gdb/p-valprint.c        |  6 +++---
 gdb/stabsread.c         |  6 +++---
 gdb/typeprint.c         | 12 ++++++------
 9 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index bf50d72..7a6e093 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7480,17 +7480,17 @@ struct type *
 ada_find_parallel_type (struct type *type, const char *suffix)
 {
   char *name;
-  const char *typename = ada_type_name (type);
+  const char *type_name = ada_type_name (type);
   int len;
 
-  if (typename == NULL)
+  if (type_name == NULL)
     return NULL;
 
-  len = strlen (typename);
+  len = strlen (type_name);
 
   name = (char *) alloca (len + strlen (suffix) + 1);
 
-  strcpy (name, typename);
+  strcpy (name, type_name);
   strcpy (name + len, suffix);
 
   return ada_find_parallel_type_with_name (type, name);
diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c
index fb24725..afeca1e 100644
--- a/gdb/break-catch-throw.c
+++ b/gdb/break-catch-throw.c
@@ -168,7 +168,7 @@ check_status_exception_catchpoint (struct bpstats *bs)
 {
   struct exception_catchpoint *self
     = (struct exception_catchpoint *) bs->breakpoint_at;
-  char *typename = NULL;
+  char *type_name = NULL;
   volatile struct gdb_exception e;
 
   bkpt_breakpoint_ops.check_status (bs);
@@ -184,22 +184,22 @@ check_status_exception_catchpoint (struct bpstats *bs)
       char *canon;
 
       fetch_probe_arguments (NULL, &typeinfo_arg);
-      typename = cplus_typename_from_type_info (typeinfo_arg);
+      type_name = cplus_typename_from_type_info (typeinfo_arg);
 
-      canon = cp_canonicalize_string (typename);
+      canon = cp_canonicalize_string (type_name);
       if (canon != NULL)
 	{
-	  xfree (typename);
-	  typename = canon;
+	  xfree (type_name);
+	  type_name = canon;
 	}
     }
 
   if (e.reason < 0)
     exception_print (gdb_stderr, e);
-  else if (regexec (self->pattern, typename, 0, NULL, 0) != 0)
+  else if (regexec (self->pattern, type_name, 0, NULL, 0) != 0)
     bs->stop = 0;
 
-  xfree (typename);
+  xfree (type_name);
 }
 
 /* Implement the 're_set' method.  */
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 1d7147c..8734bb7 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -98,9 +98,9 @@ const char vtbl_ptr_name[] = "__vtbl_ptr_type";
 int
 cp_is_vtbl_ptr_type (struct type *type)
 {
-  const char *typename = type_name_no_tag (type);
+  const char *type_name = type_name_no_tag (type);
 
-  return (typename != NULL && !strcmp (typename, vtbl_ptr_name));
+  return (type_name != NULL && !strcmp (type_name, vtbl_ptr_name));
 }
 
 /* Return truth value for the assertion that TYPE is of the type
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 43cf150..f7518ad 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -12263,7 +12263,7 @@ static int
 dwarf2_is_constructor (struct die_info *die, struct dwarf2_cu *cu)
 {
   const char *fieldname;
-  const char *typename;
+  const char *type_name;
   int len;
 
   if (die->parent == NULL)
@@ -12275,13 +12275,13 @@ dwarf2_is_constructor (struct die_info *die, struct dwarf2_cu *cu)
     return 0;
 
   fieldname = dwarf2_name (die, cu);
-  typename = dwarf2_name (die->parent, cu);
-  if (fieldname == NULL || typename == NULL)
+  type_name = dwarf2_name (die->parent, cu);
+  if (fieldname == NULL || type_name == NULL)
     return 0;
 
   len = strlen (fieldname);
-  return (strncmp (fieldname, typename, len) == 0
-	  && (typename[len] == '\0' || typename[len] == '<'));
+  return (strncmp (fieldname, type_name, len) == 0
+	  && (type_name[len] == '\0' || type_name[len] == '<'));
 }
 
 /* Add a member function to the proper fieldlist.  */
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index c09c9f3..873a84d 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1371,7 +1371,7 @@ struct type *
 lookup_struct_elt_type (struct type *type, const char *name, int noerr)
 {
   int i;
-  char *typename;
+  char *type_name;
 
   for (;;)
     {
@@ -1385,9 +1385,9 @@ lookup_struct_elt_type (struct type *type, const char *name, int noerr)
   if (TYPE_CODE (type) != TYPE_CODE_STRUCT 
       && TYPE_CODE (type) != TYPE_CODE_UNION)
     {
-      typename = type_to_string (type);
-      make_cleanup (xfree, typename);
-      error (_("Type %s is not a structure or union type."), typename);
+      type_name = type_to_string (type);
+      make_cleanup (xfree, type_name);
+      error (_("Type %s is not a structure or union type."), type_name);
     }
 
 #if 0
@@ -1396,10 +1396,10 @@ lookup_struct_elt_type (struct type *type, const char *name, int noerr)
      I.e. when doing "ptype bell->bar" for "struct foo { int bar; int
      foo; } bell;" Disabled by fnf.  */
   {
-    char *typename;
+    char *type_name;
 
-    typename = type_name_no_tag (type);
-    if (typename != NULL && strcmp (typename, name) == 0)
+    type_name = type_name_no_tag (type);
+    if (type_name != NULL && strcmp (type_name, name) == 0)
       return type;
   }
 #endif
@@ -1439,9 +1439,9 @@ lookup_struct_elt_type (struct type *type, const char *name, int noerr)
       return NULL;
     }
 
-  typename = type_to_string (type);
-  make_cleanup (xfree, typename);
-  error (_("Type %s has no component named %s."), typename, name);
+  type_name = type_to_string (type);
+  make_cleanup (xfree, type_name);
+  error (_("Type %s has no component named %s."), type_name, name);
 }
 
 /* Lookup the vptr basetype/fieldno values for TYPE.
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 1821f18..4bc7645 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -1066,7 +1066,7 @@ gnuv3_get_typeid (struct value *value)
   struct gdbarch *gdbarch;
   struct cleanup *cleanup;
   struct value *result;
-  char *typename, *canonical;
+  char *type_name, *canonical;
 
   /* We have to handle values a bit trickily here, to allow this code
      to work properly with non_lvalue values that are really just
@@ -1085,20 +1085,20 @@ gnuv3_get_typeid (struct value *value)
   type = make_cv_type (0, 0, type, NULL);
   gdbarch = get_type_arch (type);
 
-  typename = type_to_string (type);
-  if (typename == NULL)
+  type_name = type_to_string (type);
+  if (type_name == NULL)
     error (_("cannot find typeinfo for unnamed type"));
-  cleanup = make_cleanup (xfree, typename);
+  cleanup = make_cleanup (xfree, type_name);
 
   /* We need to canonicalize the type name here, because we do lookups
      using the demangled name, and so we must match the format it
      uses.  E.g., GDB tends to use "const char *" as a type name, but
      the demangler uses "char const *".  */
-  canonical = cp_canonicalize_string (typename);
+  canonical = cp_canonicalize_string (type_name);
   if (canonical != NULL)
     {
       make_cleanup (xfree, canonical);
-      typename = canonical;
+      type_name = canonical;
     }
 
   typeinfo_type = gnuv3_get_typeid_type (gdbarch);
@@ -1114,7 +1114,7 @@ gnuv3_get_typeid (struct value *value)
 
       vtable = gnuv3_get_vtable (gdbarch, type, address);
       if (vtable == NULL)
-	error (_("cannot find typeinfo for object of type '%s'"), typename);
+	error (_("cannot find typeinfo for object of type '%s'"), type_name);
       typeinfo_value = value_field (vtable, vtable_field_type_info);
       result = value_ind (value_cast (make_pointer_type (typeinfo_type, NULL),
 				      typeinfo_value));
@@ -1124,12 +1124,12 @@ gnuv3_get_typeid (struct value *value)
       char *sym_name;
       struct minimal_symbol *minsym;
 
-      sym_name = concat ("typeinfo for ", typename, (char *) NULL);
+      sym_name = concat ("typeinfo for ", type_name, (char *) NULL);
       make_cleanup (xfree, sym_name);
       minsym = lookup_minimal_symbol (sym_name, NULL, NULL);
 
       if (minsym == NULL)
-	error (_("could not find typeinfo symbol for '%s'"), typename);
+	error (_("could not find typeinfo symbol for '%s'"), type_name);
 
       result = value_at_lazy (typeinfo_type, SYMBOL_VALUE_ADDRESS (minsym));
     }
@@ -1177,21 +1177,21 @@ gnuv3_get_typename_from_type_info (struct value *type_info_ptr)
 static struct type *
 gnuv3_get_type_from_type_info (struct value *type_info_ptr)
 {
-  char *typename;
+  char *type_name;
   struct cleanup *cleanup;
   struct value *type_val;
   struct expression *expr;
   struct type *result;
 
-  typename = gnuv3_get_typename_from_type_info (type_info_ptr);
-  cleanup = make_cleanup (xfree, typename);
+  type_name = gnuv3_get_typename_from_type_info (type_info_ptr);
+  cleanup = make_cleanup (xfree, type_name);
 
   /* We have to parse the type name, since in general there is not a
      symbol for a type.  This is somewhat bogus since there may be a
      mis-parse.  Another approach might be to re-use the demangler's
      internal form to reconstruct the type somehow.  */
 
-  expr = parse_expression (typename);
+  expr = parse_expression (type_name);
   make_cleanup (xfree, expr);
 
   type_val = evaluate_type (expr);
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index e6d4b91..e71b0c0 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -483,10 +483,10 @@ const char pascal_vtbl_ptr_name[] =
 int
 pascal_object_is_vtbl_ptr_type (struct type *type)
 {
-  const char *typename = type_name_no_tag (type);
+  const char *type_name = type_name_no_tag (type);
 
-  return (typename != NULL
-	  && strcmp (typename, pascal_vtbl_ptr_name) == 0);
+  return (type_name != NULL
+	  && strcmp (type_name, pascal_vtbl_ptr_name) == 0);
 }
 
 /* Return truth value for the assertion that TYPE is of the type
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 2ac4dae..49800dc 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -4548,9 +4548,9 @@ cleanup_undefined_types_1 (void)
 		struct pending *ppt;
 		int i;
 		/* Name of the type, without "struct" or "union".  */
-		const char *typename = TYPE_TAG_NAME (*type);
+		const char *type_name = TYPE_TAG_NAME (*type);
 
-		if (typename == NULL)
+		if (type_name == NULL)
 		  {
 		    complaint (&symfile_complaints, _("need a type name"));
 		    break;
@@ -4568,7 +4568,7 @@ cleanup_undefined_types_1 (void)
 			    && (TYPE_INSTANCE_FLAGS (*type) ==
 				TYPE_INSTANCE_FLAGS (SYMBOL_TYPE (sym)))
 			    && strcmp (SYMBOL_LINKAGE_NAME (sym),
-				       typename) == 0)
+				       type_name) == 0)
                           replace_type (*type, SYMBOL_TYPE (sym));
 		      }
 		  }
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index 36b2f47..3569ad0 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -500,12 +500,12 @@ whatis_command (char *exp, int from_tty)
   whatis_exp (exp, -1);
 }
 
-/* TYPENAME is either the name of a type, or an expression.  */
+/* TYPE_NAME is either the name of a type, or an expression.  */
 
 static void
-ptype_command (char *typename, int from_tty)
+ptype_command (char *type_name, int from_tty)
 {
-  whatis_exp (typename, 1);
+  whatis_exp (type_name, 1);
 }
 
 /* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM.
@@ -596,16 +596,16 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
    and whatis_command().  */
 
 void
-maintenance_print_type (char *typename, int from_tty)
+maintenance_print_type (char *type_name, int from_tty)
 {
   struct value *val;
   struct type *type;
   struct cleanup *old_chain;
   struct expression *expr;
 
-  if (typename != NULL)
+  if (type_name != NULL)
     {
-      expr = parse_expression (typename);
+      expr = parse_expression (type_name);
       old_chain = make_cleanup (free_current_contents, &expr);
       if (expr->elts[0].opcode == OP_TYPE)
 	{
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 02/18] poison "new"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (8 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 05/18] poison "private" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 10/18] poison "operator" Ondrej Oprala
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* bcache.c (new_bstr): Renamed from new.
	* buildsym.c (new_ctx): Likewise.
	* cleanups.c (new_cleanup): Likewise.
	* cli/cli-setshow.c (new_str): Likewise.
	* coffread.c (new_ctx): Likewise.
	* continuations.c (new_cont): Likewise.
	* cp-namespace.c (new_direct): Likewise.
	* cp-support.c (new_comp): Likewise.
	* dbxread.c (new_ctx): Likewise.
	* dwarf2read.c (new_ctx): Likewise.
	* environ.c (new_str): Likewise.
	* gdbtypes.c (new_type): Likewise.
	* jit.c (new_block): Likewise.
	* jv-exp.y (new_expr): Likewise.
	* macrotab.c (new_file): Likewise.
	* mdebugread.c (new_stack): Likewise.
	* memattr.c (new_region): Likewise.
	* mi/mi-cmd-var.c (new_children): Likewise.
	* minsyms.c (new_elt, new_bunch): Likewise.
	* objc-lang.c (new_selname): Likewise.
	* parse.c (new_call): Likewise.
	* printcmd.c (new_disp): Likewise.
	* solib-darwin.c (new_so): Likewise.
	* solib-irix.c (new_so): Likewise.
	* solib-som.c (new_so): Likewise.
	* solib-spu.c (new_so): Likewise.
	* solib-svr4.c (new_so): Likewise.
	* stabsread.c (new_types): Likewise.
	* symtab.c (new_str): Likewise.
	* typeprint.c (new_sym): Likewise.
	* value.c (new_chunk): Likewise.
	* varobj.c (new_children): Likewise.
	* varobj.h (new_children): Likewise.
	* xcoffread.c (new_ctx): Likewise.
---
 gdb/bcache.c          | 14 ++++-----
 gdb/buildsym.c        | 18 +++++------
 gdb/cleanups.c        | 12 +++----
 gdb/cli/cli-setshow.c | 14 ++++-----
 gdb/coffread.c        | 38 +++++++++++------------
 gdb/continuations.c   | 12 +++----
 gdb/cp-namespace.c    | 35 +++++++++++----------
 gdb/cp-support.c      | 14 ++++-----
 gdb/dbxread.c         | 43 ++++++++++++++------------
 gdb/dwarf2read.c      | 28 ++++++++---------
 gdb/environ.c         |  6 ++--
 gdb/gdbtypes.c        |  6 ++--
 gdb/jit.c             |  8 ++---
 gdb/jv-exp.y          | 21 +++++++------
 gdb/macrotab.c        | 14 ++++-----
 gdb/mdebugread.c      | 18 +++++------
 gdb/memattr.c         | 24 +++++++-------
 gdb/mi/mi-cmd-var.c   |  8 ++---
 gdb/minsyms.c         | 22 ++++++-------
 gdb/objc-lang.c       | 10 +++---
 gdb/parse.c           | 10 +++---
 gdb/printcmd.c        | 24 +++++++-------
 gdb/solib-darwin.c    | 20 ++++++------
 gdb/solib-irix.c      | 24 +++++++-------
 gdb/solib-som.c       | 66 ++++++++++++++++++++++-----------------
 gdb/solib-spu.c       | 25 ++++++++-------
 gdb/solib-svr4.c      | 86 +++++++++++++++++++++++++--------------------------
 gdb/stabsread.c       | 60 +++++++++++++++++------------------
 gdb/symtab.c          | 40 ++++++++++++------------
 gdb/typeprint.c       |  5 +--
 gdb/value.c           |  8 ++---
 gdb/varobj.c          | 41 ++++++++++++------------
 gdb/varobj.h          |  2 +-
 gdb/xcoffread.c       | 31 ++++++++++---------
 34 files changed, 412 insertions(+), 395 deletions(-)

diff --git a/gdb/bcache.c b/gdb/bcache.c
index 712142d..1d68a00 100644
--- a/gdb/bcache.c
+++ b/gdb/bcache.c
@@ -269,14 +269,14 @@ bcache_full (const void *addr, int length, struct bcache *bcache, int *added)
 
   /* The user's string isn't in the list.  Insert it after *ps.  */
   {
-    struct bstring *new
+    struct bstring *new_bstr
       = obstack_alloc (&bcache->cache, BSTRING_SIZE (length));
 
-    memcpy (&new->d.data, addr, length);
-    new->length = length;
-    new->next = bcache->bucket[hash_index];
-    new->half_hash = half_hash;
-    bcache->bucket[hash_index] = new;
+    memcpy (&new_bstr->d.data, addr, length);
+    new_bstr->length = length;
+    new_bstr->next = bcache->bucket[hash_index];
+    new_bstr->half_hash = half_hash;
+    bcache->bucket[hash_index] = new_bstr;
 
     bcache->unique_count++;
     bcache->unique_size += length;
@@ -285,7 +285,7 @@ bcache_full (const void *addr, int length, struct bcache *bcache, int *added)
     if (added)
       *added = 1;
 
-    return &new->d.data;
+    return &new_bstr->d.data;
   }
 }
 \f
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index cee0cc5..14756e1 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -1439,7 +1439,7 @@ augment_type_symtab (struct objfile *objfile, struct symtab *primary_symtab)
 struct context_stack *
 push_context (int desc, CORE_ADDR valu)
 {
-  struct context_stack *new;
+  struct context_stack *new_ctx;
 
   if (context_stack_depth == context_stack_size)
     {
@@ -1449,18 +1449,18 @@ push_context (int desc, CORE_ADDR valu)
 		  (context_stack_size * sizeof (struct context_stack)));
     }
 
-  new = &context_stack[context_stack_depth++];
-  new->depth = desc;
-  new->locals = local_symbols;
-  new->old_blocks = pending_blocks;
-  new->start_addr = valu;
-  new->using_directives = using_directives;
-  new->name = NULL;
+  new_ctx = &context_stack[context_stack_depth++];
+  new_ctx->depth = desc;
+  new_ctx->locals = local_symbols;
+  new_ctx->old_blocks = pending_blocks;
+  new_ctx->start_addr = valu;
+  new_ctx->using_directives = using_directives;
+  new_ctx->name = NULL;
 
   local_symbols = NULL;
   using_directives = NULL;
 
-  return new;
+  return new_ctx;
 }
 
 /* Pop a context block.  Returns the address of the context block just
diff --git a/gdb/cleanups.c b/gdb/cleanups.c
index 898e526..d83313c 100644
--- a/gdb/cleanups.c
+++ b/gdb/cleanups.c
@@ -79,15 +79,15 @@ static struct cleanup *
 make_my_cleanup2 (struct cleanup **pmy_chain, make_cleanup_ftype *function,
 		  void *arg,  void (*free_arg) (void *))
 {
-  struct cleanup *new
+  struct cleanup *new_cleanup
     = (struct cleanup *) xmalloc (sizeof (struct cleanup));
   struct cleanup *old_chain = *pmy_chain;
 
-  new->next = *pmy_chain;
-  new->function = function;
-  new->free_arg = free_arg;
-  new->arg = arg;
-  *pmy_chain = new;
+  new_cleanup->next = *pmy_chain;
+  new_cleanup->function = function;
+  new_cleanup->free_arg = free_arg;
+  new_cleanup->arg = arg;
+  *pmy_chain = new_cleanup;
 
   gdb_assert (old_chain != NULL);
   return old_chain;
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 0cd36c2..3e2cf91 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -159,16 +159,16 @@ do_set_command (char *arg, int from_tty, struct cmd_list_element *c)
     {
     case var_string:
       {
-	char *new;
+	char *new_str;
 	const char *p;
 	char *q;
 	int ch;
 
 	if (arg == NULL)
 	  arg = "";
-	new = (char *) xmalloc (strlen (arg) + 2);
+	new_str = (char *) xmalloc (strlen (arg) + 2);
 	p = arg;
-	q = new;
+	q = new_str;
 	while ((ch = *p++) != '\000')
 	  {
 	    if (ch == '\\')
@@ -196,18 +196,18 @@ do_set_command (char *arg, int from_tty, struct cmd_list_element *c)
 	  *q++ = ' ';
 #endif
 	*q++ = '\0';
-	new = (char *) xrealloc (new, q - new);
+	new_str = (char *) xrealloc (new_str, q - new_str);
 
 	if (*(char **) c->var == NULL
-	    || strcmp (*(char **) c->var, new) != 0)
+	    || strcmp (*(char **) c->var, new_str) != 0)
 	  {
 	    xfree (*(char **) c->var);
-	    *(char **) c->var = new;
+	    *(char **) c->var = new_str;
 
 	    option_changed = 1;
 	  }
 	else
-	  xfree (new);
+	  xfree (new_str);
       }
       break;
     case var_string_noescape:
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 959e96a..70d5e23 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -776,7 +776,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 		  struct objfile *objfile)
 {
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
-  struct context_stack *new;
+  struct context_stack *new_ctx;
   struct coff_symbol coff_symbol;
   struct coff_symbol *cs = &coff_symbol;
   static struct internal_syment main_sym;
@@ -1071,9 +1071,9 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 	         context_stack_depth is zero, and complain if not.  */
 
 	      depth = 0;
-	      new = push_context (depth, fcn_start_addr);
+	      new_ctx = push_context (depth, fcn_start_addr);
 	      fcn_cs_saved.c_name = getsymname (&fcn_sym_saved);
-	      new->name =
+	      new_ctx->name =
 		process_coff_symbol (&fcn_cs_saved, 
 				     &fcn_aux_saved, objfile);
 	    }
@@ -1096,9 +1096,9 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 		  break;
 		}
 
-	      new = pop_context ();
+	      new_ctx = pop_context ();
 	      /* Stack must be empty now.  */
-	      if (context_stack_depth > 0 || new == NULL)
+	      if (context_stack_depth > 0 || new_ctx == NULL)
 		{
 		  complaint (&symfile_complaints,
 			     _("Unmatched .ef symbol(s) ignored "
@@ -1133,8 +1133,8 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 		enter_linenos (fcn_line_ptr, fcn_first_line,
 			       fcn_last_line, objfile);
 
-	      finish_block (new->name, &local_symbols,
-			    new->old_blocks, new->start_addr,
+	      finish_block (new_ctx->name, &local_symbols,
+			    new_ctx->old_blocks, new_ctx->start_addr,
 			    fcn_cs_saved.c_value
 			    + fcn_aux_saved.x_sym.x_misc.x_fsize
 			    + ANOFFSET (objfile->section_offsets,
@@ -1164,8 +1164,8 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 		  break;
 		}
 
-	      new = pop_context ();
-	      if (depth-- != new->depth)
+	      new_ctx = pop_context ();
+	      if (depth-- != new_ctx->depth)
 		{
 		  complaint (&symfile_complaints,
 			     _("Mismatched .eb symbol ignored "
@@ -1179,11 +1179,11 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 		    cs->c_value + ANOFFSET (objfile->section_offsets,
 					    SECT_OFF_TEXT (objfile));
 		  /* Make a block for the local symbols within.  */
-		  finish_block (0, &local_symbols, new->old_blocks,
-				new->start_addr, tmpaddr, objfile);
+		  finish_block (0, &local_symbols, new_ctx->old_blocks,
+				new_ctx->start_addr, tmpaddr, objfile);
 		}
 	      /* Now pop locals of block just finished.  */
-	      local_symbols = new->locals;
+	      local_symbols = new_ctx->locals;
 	    }
 	  break;
 
@@ -2061,7 +2061,7 @@ coff_read_struct_type (int index, int length, int lastsym,
 
   struct type *type;
   struct nextfield *list = 0;
-  struct nextfield *new;
+  struct nextfield *new_ctx;
   int nfields = 0;
   int n;
   char *name;
@@ -2088,9 +2088,9 @@ coff_read_struct_type (int index, int length, int lastsym,
 	case C_MOU:
 
 	  /* Get space to record the next field's data.  */
-	  new = (struct nextfield *) alloca (sizeof (struct nextfield));
-	  new->next = list;
-	  list = new;
+	  new_ctx = (struct nextfield *) alloca (sizeof (struct nextfield));
+	  new_ctx->next = list;
+	  list = new_ctx;
 
 	  /* Save the data.  */
 	  list->field.name = obstack_copy0 (&objfile->objfile_obstack,
@@ -2105,9 +2105,9 @@ coff_read_struct_type (int index, int length, int lastsym,
 	case C_FIELD:
 
 	  /* Get space to record the next field's data.  */
-	  new = (struct nextfield *) alloca (sizeof (struct nextfield));
-	  new->next = list;
-	  list = new;
+	  new_ctx = (struct nextfield *) alloca (sizeof (struct nextfield));
+	  new_ctx->next = list;
+	  list = new_ctx;
 
 	  /* Save the data.  */
 	  list->field.name = obstack_copy0 (&objfile->objfile_obstack,
diff --git a/gdb/continuations.c b/gdb/continuations.c
index 2dfbbb3..23470fc 100644
--- a/gdb/continuations.c
+++ b/gdb/continuations.c
@@ -39,13 +39,13 @@ make_continuation (struct continuation **pmy_chain,
 		   continuation_ftype *function,
 		   void *arg,  void (*free_arg) (void *))
 {
-  struct continuation *new = XNEW (struct continuation);
+  struct continuation *new_cont = XNEW (struct continuation);
 
-  new->next = *pmy_chain;
-  new->function = function;
-  new->free_arg = free_arg;
-  new->arg = arg;
-  *pmy_chain = new;
+  new_cont->next = *pmy_chain;
+  new_cont->function = function;
+  new_cont->free_arg = free_arg;
+  new_cont->arg = arg;
+  *pmy_chain = new_cont;
 }
 
 static void
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 36134c0..f7db48c 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -133,7 +133,7 @@ cp_add_using_directive (const char *dest,
                         struct obstack *obstack)
 {
   struct using_direct *current;
-  struct using_direct *new;
+  struct using_direct *new_direct;
   
   /* Has it already been added?  */
 
@@ -170,39 +170,40 @@ cp_add_using_directive (const char *dest,
       return;
     }
 
-  new = obstack_alloc (obstack, (sizeof (*new)
+  new_direct = obstack_alloc (obstack, (sizeof (*new_direct)
 				 + (VEC_length (const_char_ptr, excludes)
-				    * sizeof (*new->excludes))));
-  memset (new, 0, sizeof (*new));
+				    * sizeof (*new_direct->excludes))));
+  memset (new_direct, 0, sizeof (*new_direct));
 
   if (copy_names)
     {
-      new->import_src = obstack_copy0 (obstack, src, strlen (src));
-      new->import_dest = obstack_copy0 (obstack, dest, strlen (dest));
+      new_direct->import_src = obstack_copy0 (obstack, src, strlen (src));
+      new_direct->import_dest = obstack_copy0 (obstack, dest, strlen (dest));
     }
   else
     {
-      new->import_src = src;
-      new->import_dest = dest;
+      new_direct->import_src = src;
+      new_direct->import_dest = dest;
     }
 
   if (alias != NULL && copy_names)
-    new->alias = obstack_copy0 (obstack, alias, strlen (alias));
+    new_direct->alias = obstack_copy0 (obstack, alias, strlen (alias));
   else
-    new->alias = alias;
+    new_direct->alias = alias;
 
   if (declaration != NULL && copy_names)
-    new->declaration = obstack_copy0 (obstack,
+    new_direct->declaration = obstack_copy0 (obstack,
 				      declaration, strlen (declaration));
   else
-    new->declaration = declaration;
+    new_direct->declaration = declaration;
 
-  memcpy (new->excludes, VEC_address (const_char_ptr, excludes),
-	  VEC_length (const_char_ptr, excludes) * sizeof (*new->excludes));
-  new->excludes[VEC_length (const_char_ptr, excludes)] = NULL;
+  memcpy (new_direct->excludes, VEC_address (const_char_ptr, excludes),
+	  VEC_length (const_char_ptr, excludes)
+	  * sizeof (*new_direct->excludes));
+  new_direct->excludes[VEC_length (const_char_ptr, excludes)] = NULL;
 
-  new->next = using_directives;
-  using_directives = new;
+  new_direct->next = using_directives;
+  using_directives = new_direct;
 }
 
 /* Test whether or not NAMESPACE looks like it mentions an anonymous
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 86f19de..2042b93 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -320,25 +320,25 @@ replace_typedefs_qualified_name (struct demangle_parse_info *info,
     {
       if (d_left (comp)->type == DEMANGLE_COMPONENT_NAME)
 	{
-	  struct demangle_component new;
+	  struct demangle_component new_comp;
 
 	  ui_file_write (buf, d_left (comp)->u.s_name.s,
 			 d_left (comp)->u.s_name.len);
 	  name = ui_file_obsavestring (buf, &info->obstack, &len);
-	  new.type = DEMANGLE_COMPONENT_NAME;
-	  new.u.s_name.s = name;
-	  new.u.s_name.len = len;
-	  if (inspect_type (info, &new, finder, data))
+	  new_comp.type = DEMANGLE_COMPONENT_NAME;
+	  new_comp.u.s_name.s = name;
+	  new_comp.u.s_name.len = len;
+	  if (inspect_type (info, &new_comp, finder, data))
 	    {
 	      char *n, *s;
 	      long slen;
 
-	      /* A typedef was substituted in NEW.  Convert it to a
+	      /* A typedef was substituted in NEW_COMP.  Convert it to a
 		 string and replace the top DEMANGLE_COMPONENT_QUAL_NAME
 		 node.  */
 
 	      ui_file_rewind (buf);
-	      n = cp_comp_to_string (&new, 100);
+	      n = cp_comp_to_string (&new_comp, 100);
 	      if (n == NULL)
 		{
 		  /* If something went astray, abort typedef substitutions.  */
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 00949ac..8c055f8 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -2721,7 +2721,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
 		    struct objfile *objfile)
 {
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
-  struct context_stack *new;
+  struct context_stack *new_ctx;
   /* This remembers the address of the start of a function.  It is
      used because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries
      are relative to the current function's start address.  On systems
@@ -2798,16 +2798,18 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
 	    }
 
 	  within_function = 0;
-	  new = pop_context ();
+	  new_ctx = pop_context ();
 
 	  /* Make a block for the local symbols within.  */
-	  block = finish_block (new->name, &local_symbols, new->old_blocks,
-				new->start_addr, new->start_addr + valu,
+	  block = finish_block (new_ctx->name, &local_symbols,
+				new_ctx->old_blocks,
+				new_ctx->start_addr, new_ctx->start_addr + valu,
 				objfile);
 
 	  /* For C++, set the block's scope.  */
-	  if (SYMBOL_LANGUAGE (new->name) == language_cplus)
-	    cp_set_block_scope (new->name, block, &objfile->objfile_obstack);
+	  if (SYMBOL_LANGUAGE (new_ctx->name) == language_cplus)
+	      cp_set_block_scope (new_ctx->name, block,
+				  &objfile->objfile_obstack);
 
 	  /* May be switching to an assembler file which may not be using
 	     block relative stabs, so reset the offset.  */
@@ -2867,8 +2869,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
 	  break;
 	}
 
-      new = pop_context ();
-      if (desc != new->depth)
+      new_ctx = pop_context ();
+      if (desc != new_ctx->depth)
 	lbrac_mismatch_complaint (symnum);
 
       if (local_symbols != NULL)
@@ -2881,7 +2883,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
 		     _("misplaced N_LBRAC entry; discarding local "
 		       "symbols which have no enclosing block"));
 	}
-      local_symbols = new->locals;
+      local_symbols = new_ctx->locals;
 
       if (context_stack_depth > 1)
 	{
@@ -2896,15 +2898,15 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
 	      /* Muzzle a compiler bug that makes end < start.
 
 		 ??? Which compilers?  Is this ever harmful?.  */
-	      if (new->start_addr > valu)
+	      if (new_ctx->start_addr > valu)
 		{
 		  complaint (&symfile_complaints,
 			     _("block start larger than block end"));
-		  new->start_addr = valu;
+		  new_ctx->start_addr = valu;
 		}
 	      /* Make a block for the local symbols within.  */
-	      finish_block (0, &local_symbols, new->old_blocks,
-			    new->start_addr, valu, objfile);
+	      finish_block (0, &local_symbols, new_ctx->old_blocks,
+			    new_ctx->start_addr, valu, objfile);
 	    }
 	}
       else
@@ -3203,20 +3205,21 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
 		{
 		  struct block *block;
 
-		  new = pop_context ();
+		  new_ctx = pop_context ();
 		  /* Make a block for the local symbols within.  */
-		  block = finish_block (new->name, &local_symbols,
-					new->old_blocks, new->start_addr,
+		  block = finish_block (new_ctx->name, &local_symbols,
+					new_ctx->old_blocks,
+					new_ctx->start_addr,
 					valu, objfile);
 
 		  /* For C++, set the block's scope.  */
-		  if (SYMBOL_LANGUAGE (new->name) == language_cplus)
-		    cp_set_block_scope (new->name, block,
+		  if (SYMBOL_LANGUAGE (new_ctx->name) == language_cplus)
+		    cp_set_block_scope (new_ctx->name, block,
 					&objfile->objfile_obstack);
 		}
 
-	      new = push_context (0, valu);
-	      new->name = define_symbol (valu, name, desc, type, objfile);
+	      new_ctx = push_context (0, valu);
+	      new_ctx->name = define_symbol (valu, name, desc, type, objfile);
 	      break;
 
 	    default:
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 3974d0b..a563a6d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -10827,7 +10827,7 @@ static void
 read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->objfile;
-  struct context_stack *new;
+  struct context_stack *new_ctx;
   CORE_ADDR lowpc;
   CORE_ADDR highpc;
   struct die_info *child_die;
@@ -10895,15 +10895,15 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
 	}
     }
 
-  new = push_context (0, lowpc);
-  new->name = new_symbol_full (die, read_type_die (die, cu), cu,
+  new_ctx = push_context (0, lowpc);
+  new_ctx->name = new_symbol_full (die, read_type_die (die, cu), cu,
 			       (struct symbol *) templ_func);
 
   /* If there is a location expression for DW_AT_frame_base, record
      it.  */
   attr = dwarf2_attr (die, DW_AT_frame_base, cu);
   if (attr)
-    dwarf2_symbol_mark_computed (attr, new->name, cu, 1);
+    dwarf2_symbol_mark_computed (attr, new_ctx->name, cu, 1);
 
   cu->list_in_scope = &local_symbols;
 
@@ -10953,9 +10953,9 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
 	}
     }
 
-  new = pop_context ();
+  new_ctx = pop_context ();
   /* Make a block for the local symbols within.  */
-  block = finish_block (new->name, &local_symbols, new->old_blocks,
+  block = finish_block (new_ctx->name, &local_symbols, new_ctx->old_blocks,
                         lowpc, highpc, objfile);
 
   /* For C++, set the block's scope.  */
@@ -10987,8 +10987,8 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
      a function declares a class that has methods).  This means that
      when we finish processing a function scope, we may need to go
      back to building a containing block's symbol lists.  */
-  local_symbols = new->locals;
-  using_directives = new->using_directives;
+  local_symbols = new_ctx->locals;
+  using_directives = new_ctx->using_directives;
 
   /* If we've finished processing a top-level function, subsequent
      symbols go in the file symbol list.  */
@@ -11003,7 +11003,7 @@ static void
 read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->objfile;
-  struct context_stack *new;
+  struct context_stack *new_ctx;
   CORE_ADDR lowpc, highpc;
   struct die_info *child_die;
   CORE_ADDR baseaddr;
@@ -11030,13 +11030,13 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
 	  child_die = sibling_die (child_die);
 	}
     }
-  new = pop_context ();
+  new_ctx = pop_context ();
 
   if (local_symbols != NULL || using_directives != NULL)
     {
       struct block *block
-        = finish_block (0, &local_symbols, new->old_blocks, new->start_addr,
-                        highpc, objfile);
+        = finish_block (0, &local_symbols, new_ctx->old_blocks,
+                        new_ctx->start_addr, highpc, objfile);
 
       /* Note that recording ranges after traversing children, as we
          do here, means that recording a parent's ranges entails
@@ -11050,8 +11050,8 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
          to do.  */
       dwarf2_record_block_ranges (die, block, baseaddr, cu);
     }
-  local_symbols = new->locals;
-  using_directives = new->using_directives;
+  local_symbols = new_ctx->locals;
+  using_directives = new_ctx->using_directives;
 }
 
 /* Read in DW_TAG_GNU_call_site and insert it to CU->call_site_htab.  */
diff --git a/gdb/environ.c b/gdb/environ.c
index 50653da..0992492 100644
--- a/gdb/environ.c
+++ b/gdb/environ.c
@@ -79,10 +79,10 @@ init_environ (struct gdb_environ *e)
   while (--i >= 0)
     {
       int len = strlen (e->vector[i]);
-      char *new = (char *) xmalloc (len + 1);
+      char *new_str = (char *) xmalloc (len + 1);
 
-      memcpy (new, e->vector[i], len + 1);
-      e->vector[i] = new;
+      memcpy (new_str, e->vector[i], len + 1);
+      e->vector[i] = new_str;
     }
 }
 
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 9069a11..bbac3c6 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -3400,7 +3400,7 @@ recursive_dump_type (struct type *type, int spaces)
 
 struct type_pair
 {
-  struct type *old, *new;
+  struct type *old, *new_type;
 };
 
 static hashval_t
@@ -3456,7 +3456,7 @@ copy_type_recursive (struct objfile *objfile,
   pair.old = type;
   slot = htab_find_slot (copied_types, &pair, INSERT);
   if (*slot != NULL)
-    return ((struct type_pair *) *slot)->new;
+    return ((struct type_pair *) *slot)->new_type;
 
   new_type = alloc_type_arch (get_type_arch (type));
 
@@ -3465,7 +3465,7 @@ copy_type_recursive (struct objfile *objfile,
   stored
     = obstack_alloc (&objfile->objfile_obstack, sizeof (struct type_pair));
   stored->old = type;
-  stored->new = new_type;
+  stored->new_type = new_type;
   *slot = stored;
 
   /* Copy the common fields of types.  For the main type, we simply
diff --git a/gdb/jit.c b/gdb/jit.c
index ba0be5e..4eb818c 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -531,15 +531,15 @@ jit_symtab_open_impl (struct gdb_symbol_callbacks *cb,
 
 static int
 compare_block (const struct gdb_block *const old,
-               const struct gdb_block *const new)
+               const struct gdb_block *const new_block)
 {
   if (old == NULL)
     return 1;
-  if (old->begin < new->begin)
+  if (old->begin < new_block->begin)
     return 1;
-  else if (old->begin == new->begin)
+  else if (old->begin == new_block->begin)
     {
-      if (old->end > new->end)
+      if (old->end > new_block->end)
         return 1;
       else
         return 0;
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y
index 2c5154e..e4b1cec 100644
--- a/gdb/jv-exp.y
+++ b/gdb/jv-exp.y
@@ -1421,20 +1421,21 @@ static struct expression *
 copy_exp (struct expression *expr, int endpos)
 {
   int len = length_of_subexp (expr, endpos);
-  struct expression *new
-    = (struct expression *) malloc (sizeof (*new) + EXP_ELEM_TO_BYTES (len));
-  new->nelts = len;
-  memcpy (new->elts, expr->elts + endpos - len, EXP_ELEM_TO_BYTES (len));
-  new->language_defn = 0;
-
-  return new;
+  struct expression *new_expr
+    = (struct expression *) malloc (sizeof (*new_expr)
+				    + EXP_ELEM_TO_BYTES (len));
+  new_expr->nelts = len;
+  memcpy (new_expr->elts, expr->elts + endpos - len, EXP_ELEM_TO_BYTES (len));
+  new_expr->language_defn = 0;
+
+  return new_expr;
 }
 
 /* Insert the expression NEW into the current expression (expout) at POS.  */
 static void
-insert_exp (int pos, struct expression *new)
+insert_exp (int pos, struct expression *new_expr)
 {
-  int newlen = new->nelts;
+  int newlen = new_expr->nelts;
 
   /* Grow expout if necessary.  In this function's only use at present,
      this should never be necessary.  */
@@ -1453,6 +1454,6 @@ insert_exp (int pos, struct expression *new)
       expout->elts[i + newlen] = expout->elts[i];
   }
   
-  memcpy (expout->elts + pos, new->elts, EXP_ELEM_TO_BYTES (newlen));
+  memcpy (expout->elts + pos, new_expr->elts, EXP_ELEM_TO_BYTES (newlen));
   expout_ptr += newlen;
 }
diff --git a/gdb/macrotab.c b/gdb/macrotab.c
index 2e5592b..6ee0698 100644
--- a/gdb/macrotab.c
+++ b/gdb/macrotab.c
@@ -452,7 +452,7 @@ macro_include (struct macro_source_file *source,
                int line,
                const char *included)
 {
-  struct macro_source_file *new;
+  struct macro_source_file *new_file;
   struct macro_source_file **link;
 
   /* Find the right position in SOURCE's `includes' list for the new
@@ -498,13 +498,13 @@ macro_include (struct macro_source_file *source,
   /* At this point, we know that LINE is an unused line number, and
      *LINK points to the entry an #inclusion at that line should
      precede.  */
-  new = new_source_file (source->table, included);
-  new->included_by = source;
-  new->included_at_line = line;
-  new->next_included = *link;
-  *link = new;
+  new_file = new_source_file (source->table, included);
+  new_file->included_by = source;
+  new_file->included_at_line = line;
+  new_file->next_included = *link;
+  *link = new_file;
 
-  return new;
+  return new_file;
 }
 
 
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index c27b114..a417f3c 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -432,24 +432,24 @@ static struct parse_stack
 static void
 push_parse_stack (void)
 {
-  struct parse_stack *new;
+  struct parse_stack *new_stack;
 
   /* Reuse frames if possible.  */
   if (top_stack && top_stack->prev)
-    new = top_stack->prev;
+    new_stack = top_stack->prev;
   else
-    new = (struct parse_stack *) xzalloc (sizeof (struct parse_stack));
+    new_stack = (struct parse_stack *) xzalloc (sizeof (struct parse_stack));
   /* Initialize new frame with previous content.  */
   if (top_stack)
     {
-      struct parse_stack *prev = new->prev;
+      struct parse_stack *prev = new_stack->prev;
 
-      *new = *top_stack;
-      top_stack->prev = new;
-      new->prev = prev;
-      new->next = top_stack;
+      *new_stack = *top_stack;
+      top_stack->prev = new_stack;
+      new_stack->prev = prev;
+      new_stack->next = top_stack;
     }
-  top_stack = new;
+  top_stack = new_stack;
 }
 
 /* Exit a lexical context.  */
diff --git a/gdb/memattr.c b/gdb/memattr.c
index 5c2adaa..412b0c7 100644
--- a/gdb/memattr.c
+++ b/gdb/memattr.c
@@ -112,11 +112,11 @@ mem_region_cmp (const void *untyped_lhs, const void *untyped_rhs)
 /* Allocate a new memory region, with default settings.  */
 
 void
-mem_region_init (struct mem_region *new)
+mem_region_init (struct mem_region *new_region)
 {
-  memset (new, 0, sizeof (struct mem_region));
-  new->enabled_p = 1;
-  new->attrib = default_mem_attrib;
+  memset (new_region, 0, sizeof (struct mem_region));
+  new_region->enabled_p = 1;
+  new_region->attrib = default_mem_attrib;
 }
 
 /* This function should be called before any command which would
@@ -174,7 +174,7 @@ static void
 create_mem_region (CORE_ADDR lo, CORE_ADDR hi,
 		   const struct mem_attrib *attrib)
 {
-  struct mem_region new;
+  struct mem_region new_region;
   int i, ix;
 
   /* lo == hi is a useless empty region.  */
@@ -184,11 +184,11 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi,
       return;
     }
 
-  mem_region_init (&new);
-  new.lo = lo;
-  new.hi = hi;
+  mem_region_init (&new_region);
+  new_region.lo = lo;
+  new_region.hi = hi;
 
-  ix = VEC_lower_bound (mem_region_s, mem_region_list, &new,
+  ix = VEC_lower_bound (mem_region_s, mem_region_list, &new_region,
 			mem_region_lessthan);
 
   /* Check for an overlapping memory region.  We only need to check
@@ -214,9 +214,9 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi,
 	}
     }
 
-  new.number = ++mem_number;
-  new.attrib = *attrib;
-  VEC_safe_insert (mem_region_s, mem_region_list, ix, &new);
+  new_region.number = ++mem_number;
+  new_region.attrib = *attrib;
+  VEC_safe_insert (mem_region_s, mem_region_list, ix, &new_region);
 }
 
 /*
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 57a2f6b..f32ba69 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -783,14 +783,14 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
       ui_out_field_int (uiout, "has_more",
 			varobj_has_more (r->varobj, to));
 
-      if (r->new)
+      if (r->new_children)
 	{
 	  int j;
 	  varobj_p child;
 	  struct cleanup *cleanup;
 
 	  cleanup = make_cleanup_ui_out_list_begin_end (uiout, "new_children");
-	  for (j = 0; VEC_iterate (varobj_p, r->new, j, child); ++j)
+	  for (j = 0; VEC_iterate (varobj_p, r->new_children, j, child); ++j)
 	    {
 	      struct cleanup *cleanup_child;
 
@@ -801,8 +801,8 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
 	    }
 
 	  do_cleanups (cleanup);
-	  VEC_free (varobj_p, r->new);
-	  r->new = NULL;	/* Paranoia.  */
+	  VEC_free (varobj_p, r->new_children);
+	  r->new_children = NULL;	/* Paranoia.  */
 	}
 
       do_cleanups (cleanup);
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 95dd6cf..4c388d7 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -486,7 +486,7 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc,
 {
   int lo;
   int hi;
-  int new;
+  int new_elt;
   struct objfile *objfile;
   struct minimal_symbol *msymbol;
   struct minimal_symbol *best_symbol = NULL;
@@ -550,16 +550,16 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc,
 	      while (SYMBOL_VALUE_ADDRESS (&msymbol[hi]) > pc)
 		{
 		  /* pc is still strictly less than highest address.  */
-		  /* Note "new" will always be >= lo.  */
-		  new = (lo + hi) / 2;
-		  if ((SYMBOL_VALUE_ADDRESS (&msymbol[new]) >= pc) ||
-		      (lo == new))
+		  /* Note "new_elt" will always be >= lo.  */
+		  new_elt = (lo + hi) / 2;
+		  if ((SYMBOL_VALUE_ADDRESS (&msymbol[new_elt]) >= pc) ||
+		      (lo == new_elt))
 		    {
-		      hi = new;
+		      hi = new_elt;
 		    }
 		  else
 		    {
-		      lo = new;
+		      lo = new_elt;
 		    }
 		}
 
@@ -911,7 +911,7 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
 				 struct objfile *objfile)
 {
   struct obj_section *obj_section;
-  struct msym_bunch *new;
+  struct msym_bunch *new_bunch;
   struct minimal_symbol *msymbol;
 
   /* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into
@@ -937,10 +937,10 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
 
   if (msym_bunch_index == BUNCH_SIZE)
     {
-      new = XCALLOC (1, struct msym_bunch);
+      new_bunch = XCALLOC (1, struct msym_bunch);
       msym_bunch_index = 0;
-      new->next = msym_bunch;
-      msym_bunch = new;
+      new_bunch->next = msym_bunch;
+      msym_bunch = new_bunch;
     }
   msymbol = &msym_bunch->contents[msym_bunch_index];
   SYMBOL_SET_LANGUAGE (msymbol, language_auto, &objfile->objfile_obstack);
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 8f0f858..d70c76c 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -411,16 +411,16 @@ static char *msglist_sel;
 void
 start_msglist(void)
 {
-  struct selname *new = 
+  struct selname *new_selname =
     (struct selname *) xmalloc (sizeof (struct selname));
 
-  new->next = selname_chain;
-  new->msglist_len = msglist_len;
-  new->msglist_sel = msglist_sel;
+  new_selname->next = selname_chain;
+  new_selname->msglist_len = msglist_len;
+  new_selname->msglist_sel = msglist_sel;
   msglist_len = 0;
   msglist_sel = (char *)xmalloc(1);
   *msglist_sel = 0;
-  selname_chain = new;
+  selname_chain = new_selname;
 }
 
 void
diff --git a/gdb/parse.c b/gdb/parse.c
index 07c1765..f828bbb 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -146,13 +146,13 @@ static struct funcall *funcall_chain;
 void
 start_arglist (void)
 {
-  struct funcall *new;
+  struct funcall *new_call;
 
-  new = (struct funcall *) xmalloc (sizeof (struct funcall));
-  new->next = funcall_chain;
-  new->arglist_len = arglist_len;
+  new_call = (struct funcall *) xmalloc (sizeof (struct funcall));
+  new_call->next = funcall_chain;
+  new_call->arglist_len = arglist_len;
   arglist_len = 0;
-  funcall_chain = new;
+  funcall_chain = new_call;
 }
 
 /* Return the number of arguments in a function call just terminated,
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 9bca6dd..03936f2 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1505,7 +1505,7 @@ display_command (char *arg, int from_tty)
 {
   struct format_data fmt;
   struct expression *expr;
-  struct display *new;
+  struct display *new_disp;
   int display_it = 1;
   const char *exp = arg;
 
@@ -1544,20 +1544,20 @@ display_command (char *arg, int from_tty)
       innermost_block = NULL;
       expr = parse_expression (exp);
 
-      new = (struct display *) xmalloc (sizeof (struct display));
+      new_disp = (struct display *) xmalloc (sizeof (struct display));
 
-      new->exp_string = xstrdup (exp);
-      new->exp = expr;
-      new->block = innermost_block;
-      new->pspace = current_program_space;
-      new->next = display_chain;
-      new->number = ++display_number;
-      new->format = fmt;
-      new->enabled_p = 1;
-      display_chain = new;
+      new_disp->exp_string = xstrdup (exp);
+      new_disp->exp = expr;
+      new_disp->block = innermost_block;
+      new_disp->pspace = current_program_space;
+      new_disp->next = display_chain;
+      new_disp->number = ++display_number;
+      new_disp->format = fmt;
+      new_disp->enabled_p = 1;
+      display_chain = new_disp;
 
       if (from_tty && target_has_execution)
-	do_one_display (new);
+	do_one_display (new_disp);
 
       dont_repeat ();
     }
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
index c4c6308..65565f0 100644
--- a/gdb/solib-darwin.c
+++ b/gdb/solib-darwin.c
@@ -277,7 +277,7 @@ darwin_current_sos (void)
       char *file_path;
       int errcode;
       struct darwin_so_list *dnew;
-      struct so_list *new;
+      struct so_list *new_so;
       struct cleanup *old_chain;
 
       /* Read image info from inferior.  */
@@ -308,22 +308,22 @@ darwin_current_sos (void)
 
       /* Create and fill the new so_list element.  */
       dnew = XZALLOC (struct darwin_so_list);
-      new = &dnew->sl;
+      new_so = &dnew->sl;
       old_chain = make_cleanup (xfree, dnew);
 
-      new->lm_info = &dnew->li;
+      new_so->lm_info = &dnew->li;
 
-      strncpy (new->so_name, file_path, SO_NAME_MAX_PATH_SIZE - 1);
-      new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
-      strcpy (new->so_original_name, new->so_name);
+      strncpy (new_so->so_name, file_path, SO_NAME_MAX_PATH_SIZE - 1);
+      new_so->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+      strcpy (new_so->so_original_name, new_so->so_name);
       xfree (file_path);
-      new->lm_info->lm_addr = load_addr;
+      new_so->lm_info->lm_addr = load_addr;
 
       if (head == NULL)
-	head = new;
+	head = new_so;
       else
-	tail->next = new;
-      tail = new;
+	tail->next = new_so;
+      tail = new_so;
 
       discard_cleanups (old_chain);
     }
diff --git a/gdb/solib-irix.c b/gdb/solib-irix.c
index 0dbbb1b..3ed9772 100644
--- a/gdb/solib-irix.c
+++ b/gdb/solib-irix.c
@@ -484,16 +484,16 @@ irix_current_sos (void)
 	  int errcode;
 	  char *name_buf;
 	  int name_size;
-	  struct so_list *new
+	  struct so_list *new_so
 	    = (struct so_list *) xmalloc (sizeof (struct so_list));
-	  struct cleanup *old_chain = make_cleanup (xfree, new);
+	  struct cleanup *old_chain = make_cleanup (xfree, new_so);
 
-	  memset (new, 0, sizeof (*new));
+	  memset (new_so, 0, sizeof (*new_so));
 
-	  new->lm_info = xmalloc (sizeof (struct lm_info));
-	  make_cleanup (xfree, new->lm_info);
+	  new_so->lm_info = xmalloc (sizeof (struct lm_info));
+	  make_cleanup (xfree, new_so->lm_info);
 
-	  *new->lm_info = lm;
+	  *new_so->lm_info = lm;
 
 	  /* Extract this shared object's name.  */
 	  name_size = lm.pathname_len;
@@ -515,15 +515,15 @@ irix_current_sos (void)
 		       safe_strerror (errcode));
 	  else
 	    {
-	      strncpy (new->so_name, name_buf, name_size);
-	      new->so_name[name_size] = '\0';
+	      strncpy (new_so->so_name, name_buf, name_size);
+	      new_so->so_name[name_size] = '\0';
 	      xfree (name_buf);
-	      strcpy (new->so_original_name, new->so_name);
+	      strcpy (new_so->so_original_name, new_so->so_name);
 	    }
 
-	  new->next = 0;
-	  *link_ptr = new;
-	  link_ptr = &new->next;
+	  new_so->next = 0;
+	  *link_ptr = new_so;
+	  link_ptr = &new_so->next;
 
 	  discard_cleanups (old_chain);
 	}
diff --git a/gdb/solib-som.c b/gdb/solib-som.c
index fd0ff81..08fb283 100644
--- a/gdb/solib-som.c
+++ b/gdb/solib-som.c
@@ -584,18 +584,18 @@ som_current_sos (void)
     {
       char *namebuf;
       CORE_ADDR addr;
-      struct so_list *new;
+      struct so_list *new_so;
       struct cleanup *old_chain;
       int errcode;
       struct dld_list dbuf;
       gdb_byte tsdbuf[4];
 
-      new = (struct so_list *) xmalloc (sizeof (struct so_list));
-      old_chain = make_cleanup (xfree, new);
+      new_so = (struct so_list *) xmalloc (sizeof (struct so_list));
+      old_chain = make_cleanup (xfree, new_so);
 
-      memset (new, 0, sizeof (*new));
-      new->lm_info = xmalloc (sizeof (struct lm_info));
-      make_cleanup (xfree, new->lm_info);
+      memset (new_so, 0, sizeof (*new_so));
+      new_so->lm_info = xmalloc (sizeof (struct lm_info));
+      make_cleanup (xfree, new_so->lm_info);
 
       read_memory (lm, (gdb_byte *)&dbuf, sizeof (struct dld_list));
 
@@ -607,15 +607,15 @@ som_current_sos (void)
 		 safe_strerror (errcode));
       else
 	{
-	  strncpy (new->so_name, namebuf, SO_NAME_MAX_PATH_SIZE - 1);
-	  new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+	  strncpy (new_so->so_name, namebuf, SO_NAME_MAX_PATH_SIZE - 1);
+	  new_so->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
 	  xfree (namebuf);
-	  strcpy (new->so_original_name, new->so_name);
+	  strcpy (new_so->so_original_name, new_so->so_name);
 	}
 
-	if (new->so_name[0] && !match_main (new->so_name))
+	if (new_so->so_name[0] && !match_main (new_so->so_name))
 	  {
-	    struct lm_info *lmi = new->lm_info;
+	    struct lm_info *lmi = new_so->lm_info;
 	    unsigned int tmp;
 
 	    lmi->lm_addr = lm;
@@ -641,41 +641,49 @@ som_current_sos (void)
 	      = extract_unsigned_integer (tsdbuf, 4, byte_order);
 
 #ifdef SOLIB_SOM_DBG
-	    printf ("\n+ library \"%s\" is described at %s\n", new->so_name,
+	    printf ("\n+ library \"%s\" is described at %s\n", new_so->so_name,
 	    	    paddress (target_gdbarch (), lm));
-	    printf ("  'version' is %d\n", new->lm_info->struct_version);
-	    printf ("  'bind_mode' is %d\n", new->lm_info->bind_mode);
+	    printf ("  'version' is %d\n", new_so->lm_info->struct_version);
+	    printf ("  'bind_mode' is %d\n", new_so->lm_info->bind_mode);
 	    printf ("  'library_version' is %d\n", 
-	    	    new->lm_info->library_version);
+	    	    new_so->lm_info->library_version);
 	    printf ("  'text_addr' is %s\n",
-	    	    paddress (target_gdbarch (), new->lm_info->text_addr));
+	    	    paddress (target_gdbarch (),
+		    new_so->lm_info->text_addr));
 	    printf ("  'text_link_addr' is %s\n",
-	    	    paddress (target_gdbarch (), new->lm_info->text_link_addr));
+	    	    paddress (target_gdbarch (),
+			      new_so->lm_info->text_link_addr));
 	    printf ("  'text_end' is %s\n",
-	    	    paddress (target_gdbarch (), new->lm_info->text_end));
+	    	    paddress (target_gdbarch (),
+		    new_so->lm_info->text_end));
 	    printf ("  'data_start' is %s\n",
-	    	    paddress (target_gdbarch (), new->lm_info->data_start));
+	    	    paddress (target_gdbarch (),
+		    new_so->lm_info->data_start));
 	    printf ("  'bss_start' is %s\n",
-	    	    paddress (target_gdbarch (), new->lm_info->bss_start));
+	    	    paddress (target_gdbarch (),
+		    new_so->lm_info->bss_start));
 	    printf ("  'data_end' is %s\n",
-	    	    paddress (target_gdbarch (), new->lm_info->data_end));
+	    	    paddress (target_gdbarch (),
+		    new_so->lm_info->data_end));
 	    printf ("  'got_value' is %s\n",
-	    	    paddress (target_gdbarch (), new->lm_info->got_value));
+	    	    paddress (target_gdbarch (),
+		    new_so->lm_info->got_value));
 	    printf ("  'tsd_start_addr' is %s\n",
-	    	    paddress (target_gdbarch (), new->lm_info->tsd_start_addr));
+	    	    paddress (target_gdbarch (),
+			      new_so->lm_info->tsd_start_addr));
 #endif
 
-	    new->addr_low = lmi->text_addr;
-	    new->addr_high = lmi->text_end;
+	    new_so->addr_low = lmi->text_addr;
+	    new_so->addr_high = lmi->text_end;
 
 	    /* Link the new object onto the list.  */
-	    new->next = NULL;
-	    *link_ptr = new;
-	    link_ptr = &new->next;
+	    new_so->next = NULL;
+	    *link_ptr = new_so;
+	    link_ptr = &new_so->next;
 	  }
  	else
 	  {
-	    free_so (new);
+	    free_so (new_so);
 	  }
 
       lm = EXTRACT (next);
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index 626cc8f..eb3900d 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -122,19 +122,20 @@ append_ocl_sos (struct so_list **link_ptr)
 					      byte_order);
 	      if (data != 0x0)
 		{
-		  struct so_list *new;
+		  struct so_list *new_so;
 
 		  /* Allocate so_list structure.  */
-		  new = XZALLOC (struct so_list);
+		  new_so = XZALLOC (struct so_list);
 
 		  /* Encode FD and object ID in path name.  */
-		  xsnprintf (new->so_name, sizeof new->so_name, "@%s <%d>",
+		  xsnprintf (new_so->so_name, sizeof new_so->so_name,
+			     "@%s <%d>",
 			     hex_string (data),
 			     SPUADDR_SPU (*ocl_program_addr_base));
-		  strcpy (new->so_original_name, new->so_name);
+		  strcpy (new_so->so_original_name, new_so->so_name);
 
-		  *link_ptr = new;
-		  link_ptr = &new->next;
+		  *link_ptr = new_so;
+		  link_ptr = &new_so->next;
 		}
 	    }
 	  if (ex.reason < 0)
@@ -198,7 +199,7 @@ spu_current_sos (void)
   for (i = 0; i < size; i += 4)
     {
       int fd = extract_unsigned_integer (buf + i, 4, byte_order);
-      struct so_list *new;
+      struct so_list *new_so;
 
       unsigned long long addr;
       char annex[32], id[100];
@@ -217,16 +218,16 @@ spu_current_sos (void)
 	continue;
 
       /* Allocate so_list structure.  */
-      new = XZALLOC (struct so_list);
+      new_so = XZALLOC (struct so_list);
 
       /* Encode FD and object ID in path name.  Choose the name so as not
 	 to conflict with any (normal) SVR4 library path name.  */
-      xsnprintf (new->so_name, sizeof new->so_name, "@%s <%d>",
+      xsnprintf (new_so->so_name, sizeof new_so->so_name, "@%s <%d>",
 		 hex_string (addr), fd);
-      strcpy (new->so_original_name, new->so_name);
+      strcpy (new_so->so_original_name, new_so->so_name);
 
-      *link_ptr = new;
-      link_ptr = &new->next;
+      *link_ptr = new_so;
+      link_ptr = &new_so->next;
     }
 
   /* Append OpenCL sos.  */
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index ddbbd94..3a88723 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -938,7 +938,7 @@ svr4_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
 {
   struct svr4_info *info;
   CORE_ADDR ldsomap;
-  struct so_list *new;
+  struct so_list *new_so;
   struct cleanup *old_chain;
   CORE_ADDR name_lm;
 
@@ -953,11 +953,11 @@ svr4_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
   if (!ldsomap)
     return 0;
 
-  new = XZALLOC (struct so_list);
-  old_chain = make_cleanup (xfree, new);
-  new->lm_info = lm_info_read (ldsomap);
-  make_cleanup (xfree, new->lm_info);
-  name_lm = new->lm_info ? new->lm_info->l_name : 0;
+  new_so = XZALLOC (struct so_list);
+  old_chain = make_cleanup (xfree, new_so);
+  new_so->lm_info = lm_info_read (ldsomap);
+  make_cleanup (xfree, new_so->lm_info);
+  name_lm = new_so->lm_info ? new_so->lm_info->l_name : 0;
   do_cleanups (old_chain);
 
   return (name_lm >= vaddr && name_lm < vaddr + size);
@@ -1093,17 +1093,17 @@ svr4_copy_library_list (struct so_list *src)
 
   while (src != NULL)
     {
-      struct so_list *new;
+      struct so_list *new_so;
 
-      new = xmalloc (sizeof (struct so_list));
-      memcpy (new, src, sizeof (struct so_list));
+      new_so = xmalloc (sizeof (struct so_list));
+      memcpy (new_so, src, sizeof (struct so_list));
 
-      new->lm_info = xmalloc (sizeof (struct lm_info));
-      memcpy (new->lm_info, src->lm_info, sizeof (struct lm_info));
+      new_so->lm_info = xmalloc (sizeof (struct lm_info));
+      memcpy (new_so->lm_info, src->lm_info, sizeof (struct lm_info));
 
-      new->next = NULL;
-      *link = new;
-      link = &new->next;
+      new_so->next = NULL;
+      *link = new_so;
+      link = &new_so->next;
 
       src = src->next;
     }
@@ -1278,24 +1278,24 @@ static struct so_list *
 svr4_default_sos (void)
 {
   struct svr4_info *info = get_svr4_info ();
-  struct so_list *new;
+  struct so_list *new_so;
 
   if (!info->debug_loader_offset_p)
     return NULL;
 
-  new = XZALLOC (struct so_list);
+  new_so = XZALLOC (struct so_list);
 
-  new->lm_info = xzalloc (sizeof (struct lm_info));
+  new_so->lm_info = xzalloc (sizeof (struct lm_info));
 
   /* Nothing will ever check the other fields if we set l_addr_p.  */
-  new->lm_info->l_addr = info->debug_loader_offset;
-  new->lm_info->l_addr_p = 1;
+  new_so->lm_info->l_addr = info->debug_loader_offset;
+  new_so->lm_info->l_addr_p = 1;
 
-  strncpy (new->so_name, info->debug_loader_name, SO_NAME_MAX_PATH_SIZE - 1);
-  new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
-  strcpy (new->so_original_name, new->so_name);
+  strncpy (new_so->so_name, info->debug_loader_name, SO_NAME_MAX_PATH_SIZE - 1);
+  new_so->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+  strcpy (new_so->so_original_name, new_so->so_name);
 
-  return new;
+  return new_so;
 }
 
 /* Read the whole inferior libraries chain starting at address LM.
@@ -1315,28 +1315,28 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
 
   for (; lm != 0; prev_lm = lm, lm = next_lm)
     {
-      struct so_list *new;
+      struct so_list *new_so;
       struct cleanup *old_chain;
       int errcode;
       char *buffer;
 
-      new = XZALLOC (struct so_list);
-      old_chain = make_cleanup_free_so (new);
+      new_so = XZALLOC (struct so_list);
+      old_chain = make_cleanup_free_so (new_so);
 
-      new->lm_info = lm_info_read (lm);
-      if (new->lm_info == NULL)
+      new_so->lm_info = lm_info_read (lm);
+      if (new_so->lm_info == NULL)
 	{
 	  do_cleanups (old_chain);
 	  return 0;
 	}
 
-      next_lm = new->lm_info->l_next;
+      next_lm = new_so->lm_info->l_next;
 
-      if (new->lm_info->l_prev != prev_lm)
+      if (new_so->lm_info->l_prev != prev_lm)
 	{
 	  warning (_("Corrupted shared library list: %s != %s"),
 		   paddress (target_gdbarch (), prev_lm),
-		   paddress (target_gdbarch (), new->lm_info->l_prev));
+		   paddress (target_gdbarch (), new_so->lm_info->l_prev));
 	  do_cleanups (old_chain);
 	  return 0;
 	}
@@ -1346,18 +1346,18 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
          SVR4, it has no name.  For others (Solaris 2.3 for example), it
          does have a name, so we can no longer use a missing name to
          decide when to ignore it.  */
-      if (ignore_first && new->lm_info->l_prev == 0)
+      if (ignore_first && new_so->lm_info->l_prev == 0)
 	{
 	  struct svr4_info *info = get_svr4_info ();
 
-	  first = new;
-	  info->main_lm_addr = new->lm_info->lm_addr;
+   first = new_so;
+	  info->main_lm_addr = new_so->lm_info->lm_addr;
 	  do_cleanups (old_chain);
 	  continue;
 	}
 
       /* Extract this shared object's name.  */
-      target_read_string (new->lm_info->l_name, &buffer,
+      target_read_string (new_so->lm_info->l_name, &buffer,
 			  SO_NAME_MAX_PATH_SIZE - 1, &errcode);
       if (errcode != 0)
 	{
@@ -1366,30 +1366,30 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
 	     object, but (most likely) a vDSO.  In this case, silently
 	     skip it; otherwise emit a warning. */
 	  if (first == NULL
-	      || new->lm_info->l_name != first->lm_info->l_name)
+	      || new_so->lm_info->l_name != first->lm_info->l_name)
 	    warning (_("Can't read pathname for load map: %s."),
 		     safe_strerror (errcode));
 	  do_cleanups (old_chain);
 	  continue;
 	}
 
-      strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
-      new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
-      strcpy (new->so_original_name, new->so_name);
+      strncpy (new_so->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+      new_so->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+      strcpy (new_so->so_original_name, new_so->so_name);
       xfree (buffer);
 
       /* If this entry has no name, or its name matches the name
 	 for the main executable, don't include it in the list.  */
-      if (! new->so_name[0] || match_main (new->so_name))
+      if (! new_so->so_name[0] || match_main (new_so->so_name))
 	{
 	  do_cleanups (old_chain);
 	  continue;
 	}
 
       discard_cleanups (old_chain);
-      new->next = 0;
-      **link_ptr_ptr = new;
-      *link_ptr_ptr = &new->next;
+      new_so->next = 0;
+      **link_ptr_ptr = new_so;
+      *link_ptr_ptr = &new_so->next;
     }
 
   return 1;
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index da95a7e..2ac4dae 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -1809,10 +1809,10 @@ again:
         while (**pp && **pp != '#')
           {
             struct type *arg_type = read_type (pp, objfile);
-            struct type_list *new = alloca (sizeof (*new));
-            new->type = arg_type;
-            new->next = arg_types;
-            arg_types = new;
+            struct type_list *new_types = alloca (sizeof (*new_types));
+            new_types->type = arg_type;
+            new_types->next = arg_types;
+            arg_types = new_types;
             num_args++;
           }
         if (**pp == '#')
@@ -2994,7 +2994,7 @@ read_struct_fields (struct field_info *fip, char **pp, struct type *type,
 		    struct objfile *objfile)
 {
   char *p;
-  struct nextfield *new;
+  struct nextfield *new_fields;
 
   /* We better set p right now, in case there are no fields at all...    */
 
@@ -3010,11 +3010,11 @@ read_struct_fields (struct field_info *fip, char **pp, struct type *type,
     {
       STABS_CONTINUE (pp, objfile);
       /* Get space to record the next field's data.  */
-      new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
-      make_cleanup (xfree, new);
-      memset (new, 0, sizeof (struct nextfield));
-      new->next = fip->list;
-      fip->list = new;
+      new_fields = (struct nextfield *) xmalloc (sizeof (struct nextfield));
+      make_cleanup (xfree, new_fields);
+      memset (new_fields, 0, sizeof (struct nextfield));
+      new_fields->next = fip->list;
+      fip->list = new_fields;
 
       /* Get the field name.  */
       p = *pp;
@@ -3092,7 +3092,7 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
 		  struct objfile *objfile)
 {
   int i;
-  struct nextfield *new;
+  struct nextfield *new_fields;
 
   if (**pp != '!')
     {
@@ -3132,14 +3132,13 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
 
   for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
     {
-      new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
-      make_cleanup (xfree, new);
-      memset (new, 0, sizeof (struct nextfield));
-      new->next = fip->list;
-      fip->list = new;
-      FIELD_BITSIZE (new->field) = 0;	/* This should be an unpacked
-					   field!  */
-
+      new_fields = (struct nextfield *) xmalloc (sizeof (struct nextfield));
+      make_cleanup (xfree, new_fields);
+      memset (new_fields, 0, sizeof (struct nextfield));
+      new_fields->next = fip->list;
+      fip->list = new_fields;
+      /* This should be an unpacked field!  */
+      FIELD_BITSIZE (new_fields->field) = 0;
       STABS_CONTINUE (pp, objfile);
       switch (**pp)
 	{
@@ -3159,8 +3158,8 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
 	}
       ++(*pp);
 
-      new->visibility = *(*pp)++;
-      switch (new->visibility)
+      new_fields->visibility = *(*pp)++;
+      switch (new_fields->visibility)
 	{
 	case VISIBILITY_PRIVATE:
 	case VISIBILITY_PROTECTED:
@@ -3172,8 +3171,8 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
 	  {
 	    complaint (&symfile_complaints,
 		       _("Unknown visibility `%c' for baseclass"),
-		       new->visibility);
-	    new->visibility = VISIBILITY_PUBLIC;
+		       new_fields->visibility);
+	    new_fields->visibility = VISIBILITY_PUBLIC;
 	  }
 	}
 
@@ -3184,7 +3183,8 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
 	   corresponding to this baseclass.  Always zero in the absence of
 	   multiple inheritance.  */
 
-	SET_FIELD_BITPOS (new->field, read_huge_number (pp, ',', &nbits, 0));
+	SET_FIELD_BITPOS (new_fields->field,
+			  read_huge_number (pp, ',', &nbits, 0));
 	if (nbits != 0)
 	  return 0;
       }
@@ -3193,8 +3193,8 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
          base class.  Read it, and remember it's type name as this
          field's name.  */
 
-      new->field.type = read_type (pp, objfile);
-      new->field.name = type_name_no_tag (new->field.type);
+      new_fields->field.type = read_type (pp, objfile);
+      new_fields->field.name = type_name_no_tag (new_fields->field.type);
 
       /* Skip trailing ';' and bump count of number of fields seen.  */
       if (**pp == ';')
@@ -4344,7 +4344,7 @@ common_block_end (struct objfile *objfile)
      symbol for the common block name for later fixup.  */
   int i;
   struct symbol *sym;
-  struct pending *new = 0;
+  struct pending *new_pending = 0;
   struct pending *next;
   int j;
 
@@ -4367,7 +4367,7 @@ common_block_end (struct objfile *objfile)
        next = next->next)
     {
       for (j = 0; j < next->nsyms; j++)
-	add_symbol_to_list (next->symbol[j], &new);
+	add_symbol_to_list (next->symbol[j], &new_pending);
     }
 
   /* Copy however much of COMMON_BLOCK we need.  If COMMON_BLOCK is
@@ -4376,9 +4376,9 @@ common_block_end (struct objfile *objfile)
 
   if (common_block != NULL)
     for (j = common_block_i; j < common_block->nsyms; j++)
-      add_symbol_to_list (common_block->symbol[j], &new);
+      add_symbol_to_list (common_block->symbol[j], &new_pending);
 
-  SYMBOL_TYPE (sym) = (struct type *) new;
+  SYMBOL_TYPE (sym) = (struct type *) new_pending;
 
   /* Should we be putting local_symbols back to what it was?
      Does it matter?  */
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 3660f1a..06997b6 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4050,29 +4050,29 @@ completion_list_add_name (const char *symname,
      of matches.  Note that the name is moved to freshly malloc'd space.  */
 
   {
-    char *new;
+    char *new_str;
 
     if (word == sym_text)
       {
-	new = xmalloc (strlen (symname) + 5);
-	strcpy (new, symname);
+	new_str = xmalloc (strlen (symname) + 5);
+	strcpy (new_str, symname);
       }
     else if (word > sym_text)
       {
 	/* Return some portion of symname.  */
-	new = xmalloc (strlen (symname) + 5);
-	strcpy (new, symname + (word - sym_text));
+	new_str = xmalloc (strlen (symname) + 5);
+	strcpy (new_str, symname + (word - sym_text));
       }
     else
       {
 	/* Return some of SYM_TEXT plus symname.  */
-	new = xmalloc (strlen (symname) + (sym_text - word) + 5);
-	strncpy (new, word, sym_text - word);
-	new[sym_text - word] = '\0';
-	strcat (new, symname);
+	new_str = xmalloc (strlen (symname) + (sym_text - word) + 5);
+	strncpy (new_str, word, sym_text - word);
+	new_str[sym_text - word] = '\0';
+	strcat (new_str, symname);
       }
 
-    VEC_safe_push (char_ptr, return_val, new);
+    VEC_safe_push (char_ptr, return_val, new_str);
   }
 }
 
@@ -4617,30 +4617,30 @@ static void
 add_filename_to_list (const char *fname, const char *text, const char *word,
 		      VEC (char_ptr) **list)
 {
-  char *new;
+  char *new_str;
   size_t fnlen = strlen (fname);
 
   if (word == text)
     {
       /* Return exactly fname.  */
-      new = xmalloc (fnlen + 5);
-      strcpy (new, fname);
+      new_str = xmalloc (fnlen + 5);
+      strcpy (new_str, fname);
     }
   else if (word > text)
     {
       /* Return some portion of fname.  */
-      new = xmalloc (fnlen + 5);
-      strcpy (new, fname + (word - text));
+      new_str = xmalloc (fnlen + 5);
+      strcpy (new_str, fname + (word - text));
     }
   else
     {
       /* Return some of TEXT plus fname.  */
-      new = xmalloc (fnlen + (text - word) + 5);
-      strncpy (new, word, text - word);
-      new[text - word] = '\0';
-      strcat (new, fname);
+      new_str = xmalloc (fnlen + (text - word) + 5);
+      strncpy (new_str, word, text - word);
+      new_str[text - word] = '\0';
+      strcat (new_str, fname);
     }
-  VEC_safe_push (char_ptr, *list, new);
+  VEC_safe_push (char_ptr, *list, new_str);
 }
 
 static int
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index 4e70593..36b2f47 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -338,9 +338,10 @@ find_typedef_in_hash (const struct type_print_options *flags, struct type *t)
    NEW is the new name for a type TYPE.  */
 
 void
-typedef_print (struct type *type, struct symbol *new, struct ui_file *stream)
+typedef_print (struct type *type, struct symbol *new_sym,
+	       struct ui_file *stream)
 {
-  LA_PRINT_TYPEDEF (type, new, stream);
+  LA_PRINT_TYPEDEF (type, new_sym, stream);
 }
 
 /* The default way to print a typedef.  */
diff --git a/gdb/value.c b/gdb/value.c
index d96d285..216e87c 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1530,13 +1530,13 @@ record_latest_value (struct value *val)
   i = value_history_count % VALUE_HISTORY_CHUNK;
   if (i == 0)
     {
-      struct value_history_chunk *new
+      struct value_history_chunk *new_chunk
 	= (struct value_history_chunk *)
 
       xmalloc (sizeof (struct value_history_chunk));
-      memset (new->values, 0, sizeof new->values);
-      new->next = value_history_chain;
-      value_history_chain = new;
+      memset (new_chunk->values, 0, sizeof new_chunk->values);
+      new_chunk->next = value_history_chain;
+      value_history_chain = new_chunk;
     }
 
   value_history_chain->values[i] = val;
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 01cf3d2..ad42135 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -725,7 +725,7 @@ static void
 install_dynamic_child (struct varobj *var,
 		       VEC (varobj_p) **changed,
 		       VEC (varobj_p) **type_changed,
-		       VEC (varobj_p) **new,
+		       VEC (varobj_p) **new_children,
 		       VEC (varobj_p) **unchanged,
 		       int *cchanged,
 		       int index,
@@ -737,9 +737,9 @@ install_dynamic_child (struct varobj *var,
       /* There's no child yet.  */
       struct varobj *child = varobj_add_child (var, name, value);
 
-      if (new)
+      if (new_children)
 	{
-	  VEC_safe_push (varobj_p, *new, child);
+	  VEC_safe_push (varobj_p, *new_children, child);
 	  *cchanged = 1;
 	}
     }
@@ -785,7 +785,7 @@ static int
 update_dynamic_varobj_children (struct varobj *var,
 				VEC (varobj_p) **changed,
 				VEC (varobj_p) **type_changed,
-				VEC (varobj_p) **new,
+				VEC (varobj_p) **new_children,
 				VEC (varobj_p) **unchanged,
 				int *cchanged,
 				int update_children,
@@ -921,7 +921,7 @@ update_dynamic_varobj_children (struct varobj *var,
 	    gdbpy_print_stack ();
 	  install_dynamic_child (var, can_mention ? changed : NULL,
 				 can_mention ? type_changed : NULL,
-				 can_mention ? new : NULL,
+				 can_mention ? new_children : NULL,
 				 can_mention ? unchanged : NULL,
 				 can_mention ? cchanged : NULL, i,
 				 xstrdup (name), v);
@@ -1689,7 +1689,7 @@ varobj_update (struct varobj **varp, int explicit)
 {
   int type_changed = 0;
   int i;
-  struct value *new;
+  struct value *new_val;
   VEC (varobj_update_result) *stack = NULL;
   VEC (varobj_update_result) *result = NULL;
 
@@ -1723,15 +1723,15 @@ varobj_update (struct varobj **varp, int explicit)
 	 the frame in which a local existed.  We are letting the 
 	 value_of_root variable dispose of the varobj if the type
 	 has changed.  */
-      new = value_of_root (varp, &type_changed);
-      if (update_type_if_necessary(*varp, new))
+      new_val = value_of_root (varp, &type_changed);
+      if (update_type_if_necessary(*varp, new_val))
 	  type_changed = 1;
       r.varobj = *varp;
       r.type_changed = type_changed;
-      if (install_new_value ((*varp), new, type_changed))
+      if (install_new_value ((*varp), new_val, type_changed))
 	r.changed = 1;
       
-      if (new == NULL)
+      if (new_val == NULL)
 	r.status = VAROBJ_NOT_IN_SCOPE;
       r.value_installed = 1;
 
@@ -1766,15 +1766,15 @@ varobj_update (struct varobj **varp, int explicit)
 	{
 	  struct type *new_type;
 
-	  new = value_of_child (v->parent, v->index);
-	  if (update_type_if_necessary(v, new))
+	  new_val = value_of_child (v->parent, v->index);
+	  if (update_type_if_necessary(v, new_val))
 	    r.type_changed = 1;
-	  if (new)
-	    new_type = value_type (new);
+	  if (new_val)
+	    new_type = value_type (new_val);
 	  else
 	    new_type = v->root->lang->type_of_child (v->parent, v->index);
 
-	  if (varobj_value_has_mutated (v, new, new_type))
+	  if (varobj_value_has_mutated (v, new_val, new_type))
 	    {
 	      /* The children are no longer valid; delete them now.
 	         Report the fact that its type changed as well.  */
@@ -1786,7 +1786,7 @@ varobj_update (struct varobj **varp, int explicit)
 	      r.type_changed = 1;
 	    }
 
-	  if (install_new_value (v, new, r.type_changed))
+	  if (install_new_value (v, new_val, r.type_changed))
 	    {
 	      r.changed = 1;
 	      v->updated = 0;
@@ -1799,7 +1799,7 @@ varobj_update (struct varobj **varp, int explicit)
       if (v->dynamic->pretty_printer != NULL)
 	{
 	  VEC (varobj_p) *changed = 0, *type_changed = 0, *unchanged = 0;
-	  VEC (varobj_p) *new = 0;
+	  VEC (varobj_p) *new_children = 0;
 	  int i, children_changed = 0;
 
 	  if (v->frozen)
@@ -1831,14 +1831,15 @@ varobj_update (struct varobj **varp, int explicit)
 
 	  /* If update_dynamic_varobj_children returns 0, then we have
 	     a non-conforming pretty-printer, so we skip it.  */
-	  if (update_dynamic_varobj_children (v, &changed, &type_changed, &new,
+	  if (update_dynamic_varobj_children (v, &changed, &type_changed,
+					      &new_children,
 					      &unchanged, &children_changed, 1,
 					      v->from, v->to))
 	    {
-	      if (children_changed || new)
+	      if (children_changed || new_children)
 		{
 		  r.children_changed = 1;
-		  r.new = new;
+		  r.new_children = new_children;
 		}
 	      /* Push in reverse order so that the first child is
 		 popped from the work stack first, and so will be
diff --git a/gdb/varobj.h b/gdb/varobj.h
index e32c6ef..87b747e 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -85,7 +85,7 @@ typedef struct varobj_update_result_t
      It lists the new children (which must necessarily come at the end
      of the child list) added during an update.  The caller is
      responsible for freeing this vector.  */
-  VEC (varobj_p) *new;
+  VEC (varobj_p) *new_children;
 } varobj_update_result;
 
 DEF_VEC_O (varobj_update_result);
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 7f34ac9..bd19a89 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1039,7 +1039,7 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
 
   /* fcn_cs_saved is global because process_xcoff_symbol needs it.  */
   union internal_auxent fcn_aux_saved = main_aux;
-  struct context_stack *new;
+  struct context_stack *new_ctx;
 
   char *filestring = " _start_ ";	/* Name of the current file.  */
 
@@ -1366,13 +1366,13 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
 
 	      within_function = 1;
 
-	      new = push_context (0, fcn_start_addr + off);
+	      new_ctx = push_context (0, fcn_start_addr + off);
 
-	      new->name = define_symbol
+	      new_ctx->name = define_symbol
 		(fcn_cs_saved.c_value + off,
 		 fcn_stab_saved.c_name, 0, 0, objfile);
-	      if (new->name != NULL)
-		SYMBOL_SECTION (new->name) = SECT_OFF_TEXT (objfile);
+	      if (new_ctx->name != NULL)
+		SYMBOL_SECTION (new_ctx->name) = SECT_OFF_TEXT (objfile);
 	    }
 	  else if (strcmp (cs->c_name, ".ef") == 0)
 	    {
@@ -1390,17 +1390,17 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
 		  within_function = 0;
 		  break;
 		}
-	      new = pop_context ();
+	      new_ctx = pop_context ();
 	      /* Stack must be empty now.  */
-	      if (context_stack_depth > 0 || new == NULL)
+	      if (context_stack_depth > 0 || new_ctx == NULL)
 		{
 		  ef_complaint (cs->c_symnum);
 		  within_function = 0;
 		  break;
 		}
 
-	      finish_block (new->name, &local_symbols, new->old_blocks,
-			    new->start_addr,
+	      finish_block (new_ctx->name, &local_symbols, new_ctx->old_blocks,
+			    new_ctx->start_addr,
 			    (fcn_cs_saved.c_value
 			     + fcn_aux_saved.x_sym.x_misc.x_fsize
 			     + ANOFFSET (objfile->section_offsets,
@@ -1471,7 +1471,7 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
 	  if (strcmp (cs->c_name, ".bb") == 0)
 	    {
 	      depth++;
-	      new = push_context (depth,
+	      new_ctx = push_context (depth,
 				  (cs->c_value
 				   + ANOFFSET (objfile->section_offsets,
 					       SECT_OFF_TEXT (objfile))));
@@ -1483,8 +1483,8 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
 		  eb_complaint (cs->c_symnum);
 		  break;
 		}
-	      new = pop_context ();
-	      if (depth-- != new->depth)
+	      new_ctx = pop_context ();
+	      if (depth-- != new_ctx->depth)
 		{
 		  eb_complaint (cs->c_symnum);
 		  break;
@@ -1492,14 +1492,15 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
 	      if (local_symbols && context_stack_depth > 0)
 		{
 		  /* Make a block for the local symbols within.  */
-		  finish_block (new->name, &local_symbols, new->old_blocks,
-				new->start_addr,
+		  finish_block (new_ctx->name, &local_symbols,
+				new_ctx->old_blocks,
+				new_ctx->start_addr,
 				(cs->c_value
 				 + ANOFFSET (objfile->section_offsets,
 					     SECT_OFF_TEXT (objfile))),
 				objfile);
 		}
-	      local_symbols = new->locals;
+	      local_symbols = new_ctx->locals;
 	    }
 	  break;
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 17/18] fix gdbarch buglet
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 16:00   ` Pedro Alves
  2013-10-21 15:37 ` [PATCH 13/18] poison "typename" Ondrej Oprala
                   ` (16 subsequent siblings)
  17 siblings, 1 reply; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog:

2013-10-09  Tom Tromey  <tromey@redhat.com>

	* gdbarch.c: Regenerate.
	(byte_order_for_code): Likewise.
	(gdbarch_byte_order): Change type of the return value.
	(gdbarch_byte_order_for_code): Likewise.
	* gdbarch.h: Regenerate.
	* gdbarch.sh (byte_order): Change the return type.
	(byte_order_for_code): Likewise.
---
 gdb/gdbarch.c  | 8 ++++----
 gdb/gdbarch.h  | 4 ++--
 gdb/gdbarch.sh | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 396bb67..3b82605 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -99,8 +99,8 @@ struct gdbarch
 
   /* basic architectural information.  */
   const struct bfd_arch_info * bfd_arch_info;
-  int byte_order;
-  int byte_order_for_code;
+  enum bfd_endian byte_order;
+  enum bfd_endian byte_order_for_code;
   enum gdb_osabi osabi;
   const struct target_desc * target_desc;
 
@@ -1444,7 +1444,7 @@ gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
   return gdbarch->bfd_arch_info;
 }
 
-int
+enum bfd_endian
 gdbarch_byte_order (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -1453,7 +1453,7 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
   return gdbarch->byte_order;
 }
 
-int
+enum bfd_endian
 gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index b58efc8..92e3ddf 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -91,10 +91,10 @@ typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
 extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
 /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized.  */
 
-extern int gdbarch_byte_order (struct gdbarch *gdbarch);
+extern enum bfd_endian gdbarch_byte_order (struct gdbarch *gdbarch);
 /* set_gdbarch_byte_order() - not applicable - pre-initialized.  */
 
-extern int gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
+extern enum bfd_endian gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
 /* set_gdbarch_byte_order_for_code() - not applicable - pre-initialized.  */
 
 extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index fa9731d..2fe535e 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -340,8 +340,8 @@ function_list ()
   cat <<EOF
 i:const struct bfd_arch_info *:bfd_arch_info:::&bfd_default_arch_struct::::gdbarch_bfd_arch_info (gdbarch)->printable_name
 #
-i:int:byte_order:::BFD_ENDIAN_BIG
-i:int:byte_order_for_code:::BFD_ENDIAN_BIG
+i:enum bfd_endian:byte_order:::BFD_ENDIAN_BIG
+i:enum bfd_endian:byte_order_for_code:::BFD_ENDIAN_BIG
 #
 i:enum gdb_osabi:osabi:::GDB_OSABI_UNKNOWN
 #
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 09/18] poison "namespace"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (3 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 01/18] poison "class" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 11/18] poison "template" Ondrej Oprala
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* ada-lang.c (domain): Renamed from namespace.
	* ada-lang.h (domain): Likewise.
	* block.h (namespace_info): Likewise.
	* common/filestuff.c (socket_namespace): Likewise.
	* common/filestuff.h (socket_namespace): Likewise.
	* cp-namespace.c (name_space): Likewise.
	* cp-support.c (name_space): Likewise.
	* cp-support.h (name_space): Likewise.
	* dwarf2read.c (domain): Likewise.
	* psymtab.c (domain): Likewise.
	* symfile.h (domain): Likewise.
---
 gdb/ada-lang.c         | 30 +++++++++++++++---------------
 gdb/ada-lang.h         |  2 +-
 gdb/block.h            |  5 +++--
 gdb/common/filestuff.c | 10 ++++++----
 gdb/common/filestuff.h |  5 +++--
 gdb/cp-namespace.c     | 30 +++++++++++++++---------------
 gdb/cp-support.c       | 38 +++++++++++++++++++-------------------
 gdb/cp-support.h       |  4 ++--
 gdb/dwarf2read.c       |  2 +-
 gdb/psymtab.c          | 10 +++++-----
 gdb/symfile.h          |  6 +++---
 11 files changed, 73 insertions(+), 69 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 9ff3ab9..69e2d2b 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -4223,14 +4223,14 @@ make_array_descriptor (struct type *type, struct value *arr)
  * used in the public sources.  */
 
 static int
-lookup_cached_symbol (const char *name, domain_enum namespace,
+lookup_cached_symbol (const char *name, domain_enum domain,
                       struct symbol **sym, struct block **block)
 {
   return 0;
 }
 
 static void
-cache_symbol (const char *name, domain_enum namespace, struct symbol *sym,
+cache_symbol (const char *name, domain_enum domain, struct symbol *sym,
               const struct block *block)
 {
 }
@@ -4453,7 +4453,7 @@ ada_lookup_simple_minsym (const char *name)
 
 static void
 add_symbols_from_enclosing_procs (struct obstack *obstackp,
-                                  const char *name, domain_enum namespace,
+                                  const char *name, domain_enum domain,
                                   int wild_match_p)
 {
 }
@@ -5132,7 +5132,7 @@ add_nonlocal_symbols (struct obstack *obstackp, const char *name,
 
 static int
 ada_lookup_symbol_list_worker (const char *name0, const struct block *block0,
-			       domain_enum namespace,
+			       domain_enum domain,
 			       struct ada_symbol_info **results,
 			       int full_search)
 {
@@ -5175,7 +5175,7 @@ ada_lookup_symbol_list_worker (const char *name0, const struct block *block0,
       if (full_search)
 	{
 	  ada_add_local_symbols (&symbol_list_obstack, name, block,
-				 namespace, wild_match_p);
+				 domain, wild_match_p);
 	}
       else
 	{
@@ -5183,7 +5183,7 @@ ada_lookup_symbol_list_worker (const char *name0, const struct block *block0,
 	     ada_iterate_over_symbols, and we don't want to search
 	     superblocks.  */
 	  ada_add_block_symbols (&symbol_list_obstack, block, name,
-				 namespace, NULL, wild_match_p);
+				 domain, NULL, wild_match_p);
 	}
       if (num_defns_collected (&symbol_list_obstack) > 0 || !full_search)
 	goto done;
@@ -5194,7 +5194,7 @@ ada_lookup_symbol_list_worker (const char *name0, const struct block *block0,
      the same result.  */
 
   cacheIfUnique = 1;
-  if (lookup_cached_symbol (name0, namespace, &sym, &block))
+  if (lookup_cached_symbol (name0, domain, &sym, &block))
     {
       if (sym != NULL)
         add_defn_to_vec (&symbol_list_obstack, sym, block);
@@ -5203,14 +5203,14 @@ ada_lookup_symbol_list_worker (const char *name0, const struct block *block0,
 
   /* Search symbols from all global blocks.  */
  
-  add_nonlocal_symbols (&symbol_list_obstack, name, namespace, 1,
+  add_nonlocal_symbols (&symbol_list_obstack, name, domain, 1,
 			wild_match_p);
 
   /* Now add symbols from all per-file blocks if we've gotten no hits
      (not strictly correct, but perhaps better than an error).  */
 
   if (num_defns_collected (&symbol_list_obstack) == 0)
-    add_nonlocal_symbols (&symbol_list_obstack, name, namespace, 0,
+    add_nonlocal_symbols (&symbol_list_obstack, name, domain, 0,
 			  wild_match_p);
 
 done:
@@ -5220,10 +5220,10 @@ done:
   ndefns = remove_extra_symbols (*results, ndefns);
 
   if (ndefns == 0 && full_search)
-    cache_symbol (name0, namespace, NULL, NULL);
+    cache_symbol (name0, domain, NULL, NULL);
 
   if (ndefns == 1 && full_search && cacheIfUnique)
-    cache_symbol (name0, namespace, (*results)[0].sym, (*results)[0].block);
+    cache_symbol (name0, domain, (*results)[0].sym, (*results)[0].block);
 
   ndefns = remove_irrelevant_renamings (*results, ndefns, block0);
 
@@ -5295,7 +5295,7 @@ ada_name_for_lookup (const char *name)
 
 void
 ada_lookup_encoded_symbol (const char *name, const struct block *block,
-			   domain_enum namespace,
+			   domain_enum domain,
 			   struct ada_symbol_info *info)
 {
   struct ada_symbol_info *candidates;
@@ -5304,7 +5304,7 @@ ada_lookup_encoded_symbol (const char *name, const struct block *block,
   gdb_assert (info != NULL);
   memset (info, 0, sizeof (struct ada_symbol_info));
 
-  n_candidates = ada_lookup_symbol_list (name, block, namespace, &candidates);
+  n_candidates = ada_lookup_symbol_list (name, block, domain, &candidates);
   if (n_candidates == 0)
     return;
 
@@ -5320,7 +5320,7 @@ ada_lookup_encoded_symbol (const char *name, const struct block *block,
 
 struct symbol *
 ada_lookup_symbol (const char *name, const struct block *block0,
-                   domain_enum namespace, int *is_a_field_of_this)
+                   domain_enum domain, int *is_a_field_of_this)
 {
   struct ada_symbol_info info;
 
@@ -5328,7 +5328,7 @@ ada_lookup_symbol (const char *name, const struct block *block0,
     *is_a_field_of_this = 0;
 
   ada_lookup_encoded_symbol (ada_encode (ada_fold_name (name)),
-			     block0, namespace, &info);
+			     block0, domain, &info);
   return info.sym;
 }
 
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index 151ced8..10212d1 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -246,7 +246,7 @@ extern struct symbol *ada_lookup_symbol (const char *, const struct block *,
                                          domain_enum, int *);
 
 extern void ada_lookup_encoded_symbol
-  (const char *name, const struct block *block, domain_enum namespace,
+  (const char *name, const struct block *block, domain_enum domain,
    struct ada_symbol_info *symbol_info);
 
 extern struct bound_minimal_symbol ada_lookup_simple_minsym (const char *);
diff --git a/gdb/block.h b/gdb/block.h
index 02e7e8b..6563b42 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -92,7 +92,7 @@ struct block
 	 this block: using directives and the current namespace
 	 scope.  */
       
-      struct block_namespace_info *namespace;
+      struct block_namespace_info *namespace_info;
     }
     cplus_specific;
   }
@@ -119,7 +119,8 @@ struct global_block
 #define BLOCK_FUNCTION(bl)	(bl)->function
 #define BLOCK_SUPERBLOCK(bl)	(bl)->superblock
 #define BLOCK_DICT(bl)		(bl)->dict
-#define BLOCK_NAMESPACE(bl)   (bl)->language_specific.cplus_specific.namespace
+#define BLOCK_NAMESPACE(bl) \
+  (bl)->language_specific.cplus_specific.namespace_info
 
 struct blockvector
 {
diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c
index 4032f36..7f35b62 100644
--- a/gdb/common/filestuff.c
+++ b/gdb/common/filestuff.c
@@ -350,10 +350,12 @@ gdb_fopen_cloexec (const char *filename, const char *opentype)
 /* See filestuff.h.  */
 
 int
-gdb_socketpair_cloexec (int namespace, int style, int protocol, int filedes[2])
+gdb_socketpair_cloexec (int socket_namespace,
+			int style, int protocol, int filedes[2])
 {
 #ifdef HAVE_SOCKETPAIR
-  int result = socketpair (namespace, style | SOCK_CLOEXEC, protocol, filedes);
+  int result = socketpair (socket_namespace,
+			   style | SOCK_CLOEXEC, protocol, filedes);
 
   if (result != -1)
     {
@@ -370,9 +372,9 @@ gdb_socketpair_cloexec (int namespace, int style, int protocol, int filedes[2])
 /* See filestuff.h.  */
 
 int
-gdb_socket_cloexec (int namespace, int style, int protocol)
+gdb_socket_cloexec (int socket_namespace, int style, int protocol)
 {
-  int result = socket (namespace, style | SOCK_CLOEXEC, protocol);
+  int result = socket (socket_namespace, style | SOCK_CLOEXEC, protocol);
 
   if (result != -1)
     socket_mark_cloexec (result);
diff --git a/gdb/common/filestuff.h b/gdb/common/filestuff.h
index b162a0c..91062a7 100644
--- a/gdb/common/filestuff.h
+++ b/gdb/common/filestuff.h
@@ -54,13 +54,14 @@ extern FILE *gdb_fopen_cloexec (const char *filename, const char *opentype);
 /* Like 'socketpair', but ensures that the returned file descriptors
    have the close-on-exec flag set.  */
 
-extern int gdb_socketpair_cloexec (int namespace, int style, int protocol,
+extern int gdb_socketpair_cloexec (int socket_namespace,
+				   int style, int protocol,
 				   int filedes[2]);
 
 /* Like 'socket', but ensures that the returned file descriptor has
    the close-on-exec flag set.  */
 
-extern int gdb_socket_cloexec (int namespace, int style, int protocol);
+extern int gdb_socket_cloexec (int socket_namespace, int style, int protocol);
 
 /* Like 'pipe', but ensures that the returned file descriptors have
    the close-on-exec flag set.  */
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index bc5ea10..caad3a1 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -210,9 +210,9 @@ cp_add_using_directive (const char *dest,
    namespace; return nonzero if so.  */
 
 int
-cp_is_anonymous (const char *namespace)
+cp_is_anonymous (const char *name_space)
 {
-  return (strstr (namespace, CP_ANONYMOUS_NAMESPACE_STR)
+  return (strstr (name_space, CP_ANONYMOUS_NAMESPACE_STR)
 	  != NULL);
 }
 
@@ -241,30 +241,30 @@ cp_lookup_symbol_nonlocal (const char *name,
 				     block, domain);
 }
 
-/* Look up NAME in the C++ namespace NAMESPACE.  Other arguments are
+/* Look up NAME in the C++ namespace NAME_SPACE.  Other arguments are
    as in cp_lookup_symbol_nonlocal.  If SEARCH is non-zero, search
    through base classes for a matching symbol.  */
 
 static struct symbol *
-cp_lookup_symbol_in_namespace (const char *namespace,
+cp_lookup_symbol_in_namespace (const char *name_space,
                                const char *name,
                                const struct block *block,
                                const domain_enum domain, int search)
 {
-  if (namespace[0] == '\0')
+  if (name_space[0] == '\0')
     {
       return lookup_symbol_file (name, block, domain, 0, search);
     }
   else
     {
-      char *concatenated_name = alloca (strlen (namespace) + 2
+      char *concatenated_name = alloca (strlen (name_space) + 2
 					+ strlen (name) + 1);
 
-      strcpy (concatenated_name, namespace);
+      strcpy (concatenated_name, name_space);
       strcat (concatenated_name, "::");
       strcat (concatenated_name, name);
       return lookup_symbol_file (concatenated_name, block, domain,
-				 cp_is_anonymous (namespace), search);
+				 cp_is_anonymous (name_space), search);
     }
 }
 
@@ -357,7 +357,7 @@ cp_lookup_symbol_imports (const char *scope,
 	  /* If there is an import of a single declaration, compare the
 	     imported declaration (after optional renaming by its alias)
 	     with the sought out name.  If there is a match pass
-	     current->import_src as NAMESPACE to direct the search
+	     current->import_src as NAME_SPACE to direct the search
 	     towards the imported namespace.  */
 	  if (current->declaration
 	      && strcmp (name, current->alias
@@ -403,7 +403,7 @@ cp_lookup_symbol_imports (const char *scope,
 	  else if (current->alias == NULL)
 	    {
 	      /* If this import statement creates no alias, pass
-		 current->inner as NAMESPACE to direct the search
+		 current->inner as NAME_SPACE to direct the search
 		 towards the imported namespace.  */
 	      sym = cp_lookup_symbol_imports (current->import_src,
 					      name, block,
@@ -571,7 +571,7 @@ lookup_namespace_scope (const char *name,
 			const char *scope,
 			int scope_len)
 {
-  char *namespace;
+  char *name_space;
 
   if (scope[scope_len] != '\0')
     {
@@ -596,10 +596,10 @@ lookup_namespace_scope (const char *name,
   /* Okay, we didn't find a match in our children, so look for the
      name in the current namespace.  */
 
-  namespace = alloca (scope_len + 1);
-  strncpy (namespace, scope, scope_len);
-  namespace[scope_len] = '\0';
-  return cp_lookup_symbol_in_namespace (namespace, name,
+  name_space = alloca (scope_len + 1);
+  strncpy (name_space, scope, scope_len);
+  name_space[scope_len] = '\0';
+  return cp_lookup_symbol_in_namespace (name_space, name,
 					block, domain, 1);
 }
 
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 2042b93..4f8b048 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -58,7 +58,7 @@ static void overload_list_add_symbol (struct symbol *sym,
 				      const char *oload_name);
 
 static void make_symbol_overload_list_using (const char *func_name,
-					     const char *namespace);
+					     const char *name_space);
 
 static void make_symbol_overload_list_qualified (const char *func_name);
 
@@ -1168,7 +1168,7 @@ overload_list_add_symbol (struct symbol *sym,
 
 struct symbol **
 make_symbol_overload_list (const char *func_name,
-			   const char *namespace)
+			   const char *name_space)
 {
   struct cleanup *old_cleanups;
   const char *name;
@@ -1181,15 +1181,15 @@ make_symbol_overload_list (const char *func_name,
 
   old_cleanups = make_cleanup (xfree, sym_return_val);
 
-  make_symbol_overload_list_using (func_name, namespace);
+  make_symbol_overload_list_using (func_name, name_space);
 
-  if (namespace[0] == '\0')
+  if (name_space[0] == '\0')
     name = func_name;
   else
     {
       char *concatenated_name
-	= alloca (strlen (namespace) + 2 + strlen (func_name) + 1);
-      strcpy (concatenated_name, namespace);
+	= alloca (strlen (name_space) + 2 + strlen (func_name) + 1);
+      strcpy (concatenated_name, name_space);
       strcat (concatenated_name, "::");
       strcat (concatenated_name, func_name);
       name = concatenated_name;
@@ -1218,23 +1218,23 @@ make_symbol_overload_list_block (const char *name,
     overload_list_add_symbol (sym, name);
 }
 
-/* Adds the function FUNC_NAME from NAMESPACE to the overload set.  */
+/* Adds the function FUNC_NAME from NAME_SPACE to the overload set.  */
 
 static void
 make_symbol_overload_list_namespace (const char *func_name,
-                                     const char *namespace)
+                                     const char *name_space)
 {
   const char *name;
   const struct block *block = NULL;
 
-  if (namespace[0] == '\0')
+  if (name_space[0] == '\0')
     name = func_name;
   else
     {
       char *concatenated_name
-	= alloca (strlen (namespace) + 2 + strlen (func_name) + 1);
+	= alloca (strlen (name_space) + 2 + strlen (func_name) + 1);
 
-      strcpy (concatenated_name, namespace);
+      strcpy (concatenated_name, name_space);
       strcat (concatenated_name, "::");
       strcat (concatenated_name, func_name);
       name = concatenated_name;
@@ -1259,7 +1259,7 @@ static void
 make_symbol_overload_list_adl_namespace (struct type *type,
                                          const char *func_name)
 {
-  char *namespace;
+  char *name_space;
   const char *type_name;
   int i, prefix_len;
 
@@ -1283,11 +1283,11 @@ make_symbol_overload_list_adl_namespace (struct type *type,
 
   if (prefix_len != 0)
     {
-      namespace = alloca (prefix_len + 1);
-      strncpy (namespace, type_name, prefix_len);
-      namespace[prefix_len] = '\0';
+      name_space = alloca (prefix_len + 1);
+      strncpy (name_space, type_name, prefix_len);
+      name_space[prefix_len] = '\0';
 
-      make_symbol_overload_list_namespace (func_name, namespace);
+      make_symbol_overload_list_namespace (func_name, name_space);
     }
 
   /* Check public base type */
@@ -1336,7 +1336,7 @@ reset_directive_searched (void *data)
 
 static void
 make_symbol_overload_list_using (const char *func_name,
-				 const char *namespace)
+				 const char *name_space)
 {
   struct using_direct *current;
   const struct block *block;
@@ -1361,7 +1361,7 @@ make_symbol_overload_list_using (const char *func_name,
         if (current->alias != NULL || current->declaration != NULL)
           continue;
 
-        if (strcmp (namespace, current->import_dest) == 0)
+        if (strcmp (name_space, current->import_dest) == 0)
 	  {
 	    /* Mark this import as searched so that the recursive call
 	       does not search it again.  */
@@ -1379,7 +1379,7 @@ make_symbol_overload_list_using (const char *func_name,
       }
 
   /* Now, add names for this namespace.  */
-  make_symbol_overload_list_namespace (func_name, namespace);
+  make_symbol_overload_list_namespace (func_name, name_space);
 }
 
 /* This does the bulk of the work of finding overloaded symbols.
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index 0f2cebb..316f057 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -179,7 +179,7 @@ extern struct type *cp_lookup_rtti_type (const char *name,
 
 /* Functions/variables from cp-namespace.c.  */
 
-extern int cp_is_anonymous (const char *namespace);
+extern int cp_is_anonymous (const char *name_space);
 
 extern void cp_add_using_directive (const char *dest,
                                     const char *src,
@@ -196,7 +196,7 @@ extern struct symbol *cp_lookup_symbol_nonlocal (const char *name,
 						 const struct block *block,
 						 const domain_enum domain);
 
-extern struct symbol *cp_lookup_symbol_namespace (const char *namespace,
+extern struct symbol *cp_lookup_symbol_namespace (const char *name_space,
 						  const char *name,
 						  const struct block *block,
 						  const domain_enum domain);
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index a563a6d..43cf150 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3735,7 +3735,7 @@ dw2_expand_symtabs_with_fullname (struct objfile *objfile,
 
 static void
 dw2_map_matching_symbols (struct objfile *objfile,
-			  const char * name, domain_enum namespace,
+			  const char * name, domain_enum domain,
 			  int global,
 			  int (*callback) (struct block *,
 					   struct symbol *, void *),
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index d9dc3e9..3109a42 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1212,7 +1212,7 @@ psymtab_to_fullname (struct partial_symtab *ps)
     ever returns non-zero, and otherwise returns 0.  */
 
 static int
-map_block (const char *name, domain_enum namespace, struct objfile *objfile,
+map_block (const char *name, domain_enum domain, struct objfile *objfile,
 	   struct block *block,
 	   int (*callback) (struct block *, struct symbol *, void *),
 	   void *data, symbol_compare_ftype *match)
@@ -1224,7 +1224,7 @@ map_block (const char *name, domain_enum namespace, struct objfile *objfile,
        sym != NULL; sym = block_iter_match_next (name, match, &iter))
     {
       if (symbol_matches_domain (SYMBOL_LANGUAGE (sym), 
-				 SYMBOL_DOMAIN (sym), namespace))
+				 SYMBOL_DOMAIN (sym), domain))
 	{
 	  if (callback (block, sym, data))
 	    return 1;
@@ -1239,7 +1239,7 @@ map_block (const char *name, domain_enum namespace, struct objfile *objfile,
 
 static void
 map_matching_symbols_psymtab (struct objfile *objfile,
-			      const char *name, domain_enum namespace,
+			      const char *name, domain_enum domain,
 			      int global,
 			      int (*callback) (struct block *,
 					       struct symbol *, void *),
@@ -1254,7 +1254,7 @@ map_matching_symbols_psymtab (struct objfile *objfile,
     {
       QUIT;
       if (ps->readin
-	  || match_partial_symbol (objfile, ps, global, name, namespace, match,
+	  || match_partial_symbol (objfile, ps, global, name, domain, match,
 				   ordered_compare))
 	{
 	  struct symtab *s = psymtab_to_symtab (objfile, ps);
@@ -1263,7 +1263,7 @@ map_matching_symbols_psymtab (struct objfile *objfile,
 	  if (s == NULL || !s->primary)
 	    continue;
 	  block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), block_kind);
-	  if (map_block (name, namespace, objfile, block,
+	  if (map_block (name, domain, objfile, block,
 			 callback, data, match))
 	    return;
 	  if (callback (block, NULL, data))
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 8e5909b..7c8881e 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -220,11 +220,11 @@ struct quick_symbol_functions
   void (*expand_symtabs_with_fullname) (struct objfile *objfile,
 					const char *fullname);
 
-  /* Find global or static symbols in all tables that are in NAMESPACE 
+  /* Find global or static symbols in all tables that are in DOMAIN
      and for which MATCH (symbol name, NAME) == 0, passing each to 
      CALLBACK, reading in partial symbol tables as needed.  Look
      through global symbols if GLOBAL and otherwise static symbols.
-     Passes NAME, NAMESPACE, and DATA to CALLBACK with each symbol
+     Passes NAME, DOMAIN, and DATA to CALLBACK with each symbol
      found.  After each block is processed, passes NULL to CALLBACK.
      MATCH must be weaker than strcmp_iw_ordered in the sense that
      strcmp_iw_ordered(x,y) == 0 --> MATCH(x,y) == 0.  ORDERED_COMPARE,
@@ -238,7 +238,7 @@ struct quick_symbol_functions
      non-zero to indicate that the scan should be terminated.  */
 
   void (*map_matching_symbols) (struct objfile *,
-				const char *name, domain_enum namespace,
+				const char *name, domain_enum domain,
 				int global,
 				int (*callback) (struct block *,
 						 struct symbol *, void *),
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 11/18] poison "template"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (4 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 09/18] poison "namespace" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 18/18] un-nest enum pvk Ondrej Oprala
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* ada-lang.c (templ): Renamed from template.
	* ia64-tdep.c (templ): Likewise.
---
 gdb/ada-lang.c  |  4 ++--
 gdb/ia64-tdep.c | 30 +++++++++++++++---------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 69e2d2b..bf50d72 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7553,9 +7553,9 @@ variant_field_index (struct type *type)
 /* A record type with no fields.  */
 
 static struct type *
-empty_record (struct type *template)
+empty_record (struct type *templ)
 {
-  struct type *type = alloc_type_copy (template);
+  struct type *type = alloc_type_copy (templ);
 
   TYPE_CODE (type) = TYPE_CODE_STRUCT;
   TYPE_NFIELDS (type) = 0;
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 44000b9..8efed4a 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -513,7 +513,7 @@ fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr)
 {
   gdb_byte bundle[BUNDLE_LEN];
   int slotnum = (int) (addr & 0x0f) / SLOT_MULTIPLIER;
-  long long template;
+  long long templ;
   int val;
 
   /* Warn about slot numbers greater than 2.  We used to generate
@@ -544,8 +544,8 @@ fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr)
     return 0;
 
   *instr = slotN_contents (bundle, slotnum);
-  template = extract_bit_field (bundle, 0, 5);
-  *it = template_encoding_table[(int)template][slotnum];
+  templ = extract_bit_field (bundle, 0, 5);
+  *it = template_encoding_table[(int)templ][slotnum];
 
   if (slotnum == 2 || (slotnum == 1 && *it == L))
     addr += 16;
@@ -643,7 +643,7 @@ ia64_memory_insert_breakpoint (struct gdbarch *gdbarch,
   int slotnum = (int) (addr & 0x0f) / SLOT_MULTIPLIER, shadow_slotnum;
   long long instr_breakpoint;
   int val;
-  int template;
+  int templ;
   struct cleanup *cleanup;
 
   if (slotnum > 2)
@@ -672,8 +672,8 @@ ia64_memory_insert_breakpoint (struct gdbarch *gdbarch,
      a breakpoint on an L-X instruction.  */
   bp_tgt->shadow_len = BUNDLE_LEN - shadow_slotnum;
 
-  template = extract_bit_field (bundle, 0, 5);
-  if (template_encoding_table[template][slotnum] == X)
+  templ = extract_bit_field (bundle, 0, 5);
+  if (template_encoding_table[templ][slotnum] == X)
     {
       /* X unit types can only be used in slot 2, and are actually
 	 part of a 2-slot L-X instruction.  We cannot break at this
@@ -682,7 +682,7 @@ ia64_memory_insert_breakpoint (struct gdbarch *gdbarch,
       gdb_assert (slotnum == 2);
       error (_("Can't insert breakpoint for non-existing slot X"));
     }
-  if (template_encoding_table[template][slotnum] == L)
+  if (template_encoding_table[templ][slotnum] == L)
     {
       /* L unit types can only be used in slot 1.  But the associated
 	 opcode for that instruction is in slot 2, so bump the slot number
@@ -740,7 +740,7 @@ ia64_memory_remove_breakpoint (struct gdbarch *gdbarch,
   int slotnum = (addr & 0x0f) / SLOT_MULTIPLIER, shadow_slotnum;
   long long instr_breakpoint, instr_saved;
   int val;
-  int template;
+  int templ;
   struct cleanup *cleanup;
 
   addr &= ~0x0f;
@@ -762,8 +762,8 @@ ia64_memory_remove_breakpoint (struct gdbarch *gdbarch,
      for addressing the SHADOW_CONTENTS placement.  */
   shadow_slotnum = slotnum;
 
-  template = extract_bit_field (bundle_mem, 0, 5);
-  if (template_encoding_table[template][slotnum] == X)
+  templ = extract_bit_field (bundle_mem, 0, 5);
+  if (template_encoding_table[templ][slotnum] == X)
     {
       /* X unit types can only be used in slot 2, and are actually
 	 part of a 2-slot L-X instruction.  We refuse to insert
@@ -777,7 +777,7 @@ ia64_memory_remove_breakpoint (struct gdbarch *gdbarch,
       do_cleanups (cleanup);
       return -1;
     }
-  if (template_encoding_table[template][slotnum] == L)
+  if (template_encoding_table[templ][slotnum] == L)
     {
       /* L unit types can only be used in slot 1.  But the breakpoint
 	 was actually saved using slot 2, so update the slot number
@@ -830,7 +830,7 @@ ia64_breakpoint_from_pc (struct gdbarch *gdbarch,
   int slotnum = (int) (*pcptr & 0x0f) / SLOT_MULTIPLIER, shadow_slotnum;
   long long instr_fetched;
   int val;
-  int template;
+  int templ;
   struct cleanup *cleanup;
 
   if (slotnum > 2)
@@ -858,13 +858,13 @@ ia64_breakpoint_from_pc (struct gdbarch *gdbarch,
 
   /* Check for L type instruction in slot 1, if present then bump up the slot
      number to the slot 2.  */
-  template = extract_bit_field (bundle, 0, 5);
-  if (template_encoding_table[template][slotnum] == X)
+  templ = extract_bit_field (bundle, 0, 5);
+  if (template_encoding_table[templ][slotnum] == X)
     {
       gdb_assert (slotnum == 2);
       error (_("Can't insert breakpoint for non-existing slot X"));
     }
-  if (template_encoding_table[template][slotnum] == L)
+  if (template_encoding_table[templ][slotnum] == L)
     {
       gdb_assert (slotnum == 1);
       slotnum = 2;
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 14/18] poison "using"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (12 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 03/18] poison "this" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 08/18] poison "mutable" Ondrej Oprala
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* block.c (using_direct): Renamed from using.
	* block.h (using_direct): Likewise.
---
 gdb/block.c | 14 +++++++-------
 gdb/block.h |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gdb/block.c b/gdb/block.c
index 643e144..7d1700e 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -34,7 +34,7 @@
 struct block_namespace_info
 {
   const char *scope;
-  struct using_direct *using;
+  struct using_direct *using_direct;
 };
 
 static void block_initialize_namespace (struct block *block,
@@ -300,21 +300,21 @@ block_using (const struct block *block)
   if (block == NULL || BLOCK_NAMESPACE (block) == NULL)
     return NULL;
   else
-    return BLOCK_NAMESPACE (block)->using;
+    return BLOCK_NAMESPACE (block)->using_direct;
 }
 
-/* Set BLOCK's using member to USING; if needed, allocate memory via
-   OBSTACK.  (It won't make a copy of USING, however, so that already
+/* Set BLOCK's using member to USING_DIRECT; if needed, allocate memory via
+   OBSTACK.  (It won't make a copy of USING_DIRECT, however, so that already
    has to be allocated correctly.)  */
 
 void
 block_set_using (struct block *block,
-		 struct using_direct *using,
+		 struct using_direct *using_direct,
 		 struct obstack *obstack)
 {
   block_initialize_namespace (block, obstack);
 
-  BLOCK_NAMESPACE (block)->using = using;
+  BLOCK_NAMESPACE (block)->using_direct = using_direct;
 }
 
 /* If BLOCK_NAMESPACE (block) is NULL, allocate it via OBSTACK and
@@ -328,7 +328,7 @@ block_initialize_namespace (struct block *block, struct obstack *obstack)
       BLOCK_NAMESPACE (block)
 	= obstack_alloc (obstack, sizeof (struct block_namespace_info));
       BLOCK_NAMESPACE (block)->scope = NULL;
-      BLOCK_NAMESPACE (block)->using = NULL;
+      BLOCK_NAMESPACE (block)->using_direct = NULL;
     }
 }
 
diff --git a/gdb/block.h b/gdb/block.h
index 6563b42..264e5a0 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -170,7 +170,7 @@ extern void block_set_scope (struct block *block, const char *scope,
 extern struct using_direct *block_using (const struct block *block);
 
 extern void block_set_using (struct block *block,
-			     struct using_direct *using,
+			     struct using_direct *using_direct,
 			     struct obstack *obstack);
 
 extern const struct block *block_static_block (const struct block *block);
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 07/18] poison "explicit"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (6 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 18/18] un-nest enum pvk Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 05/18] poison "private" Ondrej Oprala
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* mi/mi-cmd-var.c (is_explicit): Rename from explicit.
	* varobj.c (is_explicit): Likewise.
	* varobj.h (is_explicit): Likewise.
---
 gdb/mi/mi-cmd-var.c | 8 ++++----
 gdb/varobj.c        | 4 ++--
 gdb/varobj.h        | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index f32ba69..9424231 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -35,7 +35,7 @@ extern unsigned int varobjdebug;		/* defined in varobj.c.  */
 
 static void varobj_update_one (struct varobj *var,
 			       enum print_values print_values,
-			       int explicit);
+			       int is_explicit);
 
 static int mi_print_value_p (struct varobj *var,
 			     enum print_values print_values);
@@ -705,7 +705,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
       /* Get varobj handle, if a valid var obj name was specified.  */
       struct varobj *var = varobj_get_handle (name);
 
-      varobj_update_one (var, print_values, 1 /* explicit */);
+      varobj_update_one (var, print_values, 1 /* is_explicit */);
     }
 
   do_cleanups (cleanup);
@@ -715,14 +715,14 @@ mi_cmd_var_update (char *command, char **argv, int argc)
 
 static void
 varobj_update_one (struct varobj *var, enum print_values print_values,
-		   int explicit)
+		   int is_explicit)
 {
   struct ui_out *uiout = current_uiout;
   VEC (varobj_update_result) *changes;
   varobj_update_result *r;
   int i;
   
-  changes = varobj_update (&var, explicit);
+  changes = varobj_update (&var, is_explicit);
   
   for (i = 0; VEC_iterate (varobj_update_result, changes, i, r); ++i)
     {
diff --git a/gdb/varobj.c b/gdb/varobj.c
index ad42135..4ca4cf4 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1685,7 +1685,7 @@ varobj_value_has_mutated (struct varobj *var, struct value *new_value,
    to point to the new varobj.  */
 
 VEC(varobj_update_result) *
-varobj_update (struct varobj **varp, int explicit)
+varobj_update (struct varobj **varp, int is_explicit)
 {
   int type_changed = 0;
   int i;
@@ -1698,7 +1698,7 @@ varobj_update (struct varobj **varp, int explicit)
      changing type.  One use case for frozen varobjs is
      retaining previously evaluated expressions, and we don't
      want them to be reevaluated at all.  */
-  if (!explicit && (*varp)->frozen)
+  if (!is_explicit && (*varp)->frozen)
     return result;
 
   if (!(*varp)->root->is_valid)
diff --git a/gdb/varobj.h b/gdb/varobj.h
index 87b747e..edec7f9 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -300,7 +300,7 @@ extern void all_root_varobjs (void (*func) (struct varobj *var, void *data),
 			      void *data);
 
 extern VEC(varobj_update_result) *varobj_update (struct varobj **varp, 
-						 int explicit);
+						 int is_explicit);
 
 extern void varobj_invalidate (void);
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 00/18] -Wc++-compat patches v2.0
@ 2013-10-21 15:37 Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 17/18] fix gdbarch buglet Ondrej Oprala
                   ` (17 more replies)
  0 siblings, 18 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches

Hi, here are Tom's rebased patches with objections
from the previous ML thread fixed/cleared.
Thanks,
Ondrej.

Tom Tromey (18):
  poison "class"
  poison "new"
  poison "this"
  poison "public"
  poison "private"
  poison "delete"
  poison "explicit"
  poison "mutable"
  poison "namespace"
  poison "operator"
  poison "template"
  poison "try"
  poison "typename"
  poison "using"
  fix up vec
  fix up gdbtypes.h
  fix gdbarch buglet
  un-nest enum pvk

 gdb/ada-lang.c          |  42 ++---
 gdb/ada-lang.h          |   2 +-
 gdb/addrmap.c           |  58 +++----
 gdb/amd64-tdep.c        |  74 ++++----
 gdb/bcache.c            |  14 +-
 gdb/block.c             |  14 +-
 gdb/block.h             |   7 +-
 gdb/break-catch-throw.c |  14 +-
 gdb/buildsym.c          |  18 +-
 gdb/c-exp.y             |  26 +--
 gdb/cleanups.c          |  12 +-
 gdb/cli/cli-cmds.c      |   4 +-
 gdb/cli/cli-decode.c    | 143 ++++++++--------
 gdb/cli/cli-decode.h    |   2 +-
 gdb/cli/cli-script.c    |  10 +-
 gdb/cli/cli-setshow.c   |  20 +--
 gdb/coffread.c          |  38 ++---
 gdb/command.h           |  24 +--
 gdb/common/filestuff.c  |  10 +-
 gdb/common/filestuff.h  |   5 +-
 gdb/common/vec.h        |   8 +-
 gdb/continuations.c     |  12 +-
 gdb/cp-namespace.c      |  74 ++++----
 gdb/cp-support.c        |  52 +++---
 gdb/cp-support.h        |   4 +-
 gdb/cp-valprint.c       |   4 +-
 gdb/dbxread.c           |  43 ++---
 gdb/dwarf2read.c        |  40 ++---
 gdb/environ.c           |   6 +-
 gdb/f-exp.y             |  18 +-
 gdb/frame.c             |   8 +-
 gdb/gdbarch.c           |  30 ++--
 gdb/gdbarch.h           |   4 +-
 gdb/gdbarch.sh          |  26 +--
 gdb/gdbthread.h         |   6 +-
 gdb/gdbtypes.c          |  32 ++--
 gdb/gdbtypes.h          | 436 ++++++++++++++++++++++++------------------------
 gdb/gnu-v3-abi.c        |  26 +--
 gdb/go-exp.y            |   8 +-
 gdb/hppa-linux-tdep.c   |  16 +-
 gdb/i386-nat.c          |   4 +-
 gdb/ia64-tdep.c         |  30 ++--
 gdb/inferior.c          |   2 +-
 gdb/inferior.h          |   2 +-
 gdb/jit.c               |  16 +-
 gdb/jv-exp.y            |  27 +--
 gdb/linux-thread-db.c   |  42 ++---
 gdb/macrotab.c          |  14 +-
 gdb/mdebugread.c        |  54 +++---
 gdb/memattr.c           |  24 +--
 gdb/mi/mi-cmd-var.c     |  16 +-
 gdb/minsyms.c           |  22 +--
 gdb/nto-tdep.c          |   6 +-
 gdb/objc-lang.c         |  70 ++++----
 gdb/p-exp.y             |  10 +-
 gdb/p-valprint.c        |   6 +-
 gdb/parse.c             |  10 +-
 gdb/parser-defs.h       |   2 +-
 gdb/printcmd.c          |  24 +--
 gdb/prologue-value.h    |  44 ++---
 gdb/psymtab.c           |  22 +--
 gdb/python/py-symbol.c  |  25 +--
 gdb/remote-mips.c       |   4 +-
 gdb/remote.c            |  18 +-
 gdb/solib-darwin.c      |  20 +--
 gdb/solib-irix.c        |  24 +--
 gdb/solib-som.c         |  66 ++++----
 gdb/solib-spu.c         |  25 +--
 gdb/solib-svr4.c        |  86 +++++-----
 gdb/stabsread.c         |  66 ++++----
 gdb/symfile.h           |   6 +-
 gdb/symtab.c            |  40 ++---
 gdb/thread.c            |  10 +-
 gdb/top.c               |   2 +-
 gdb/typeprint.c         |  17 +-
 gdb/ui-file.h           |   2 +-
 gdb/valarith.c          |   6 +-
 gdb/value.c             |   8 +-
 gdb/varobj.c            |  45 ++---
 gdb/varobj.h            |   4 +-
 gdb/xcoffread.c         |  31 ++--
 81 files changed, 1191 insertions(+), 1151 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 15/18] fix up vec
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 17/18] fix gdbarch buglet Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 13/18] poison "typename" Ondrej Oprala
@ 2013-10-21 15:37 ` Ondrej Oprala
  2013-10-21 15:37 ` [PATCH 01/18] poison "class" Ondrej Oprala
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* common/vec.c (vec_o_preserve): Add casts to struct vec_prefix *.
	* common/vec.h (vec_free_): Add a cast to VEC(T).
	(DEF_VEC_ALLOC_FUNC_I): Add a cast to VEC(T) where necessary
	in the definitions of VEC_OP.
	(DEF_VEC_ALLOC_FUNC_P): Likewise.
	(DEF_VEC_ALLOC_FUNC_O): Likewise.
---
 gdb/common/vec.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/common/vec.h b/gdb/common/vec.h
index 86564e7..8de353c 100644
--- a/gdb/common/vec.h
+++ b/gdb/common/vec.h
@@ -391,7 +391,7 @@
 /* Reallocate an array of elements with prefix.  */
 extern void *vec_p_reserve (void *, int);
 extern void *vec_o_reserve (void *, int, size_t, size_t);
-#define vec_free_(V) xfree (V)
+#define vec_free_(V) xfree ((void *) (V))
 
 #define VEC_ASSERT_INFO ,__FILE__,__LINE__
 #define VEC_ASSERT_DECL ,const char *file_,unsigned line_
@@ -501,7 +501,7 @@ static inline void VEC_OP (T,free)					  \
 static inline void VEC_OP (T,cleanup)					  \
      (void *arg_)							  \
 {									  \
-  VEC(T) **vec_ = arg_;							  \
+  VEC(T) **vec_ = (VEC(T) **) arg_;					  \
   if (*vec_)								  \
     vec_free_ (*vec_);							  \
   *vec_ = NULL;								  \
@@ -748,7 +748,7 @@ static inline void VEC_OP (T,free)					  \
 static inline void VEC_OP (T,cleanup)					  \
      (void *arg_)							  \
 {									  \
-  VEC(T) **vec_ = arg_;							  \
+  VEC(T) **vec_ = (VEC(T) **) arg_;					  \
   if (*vec_)								  \
     vec_free_ (*vec_);							  \
   *vec_ = NULL;								  \
@@ -1058,7 +1058,7 @@ static inline void VEC_OP (T,free)					  \
 static inline void VEC_OP (T,cleanup)					  \
      (void *arg_)							  \
 {									  \
-  VEC(T) **vec_ = arg_;							  \
+  VEC(T) **vec_ = (VEC(T) **) arg_;					  \
   if (*vec_)								  \
     vec_free_ (*vec_);							  \
   *vec_ = NULL;								  \
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 16/18] fix up gdbtypes.h
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (14 preceding siblings ...)
  2013-10-21 15:37 ` [PATCH 08/18] poison "mutable" Ondrej Oprala
@ 2013-10-21 15:58 ` Ondrej Oprala
  2013-10-21 16:11 ` [PATCH 06/18] poison "delete" Ondrej Oprala
  2013-10-21 17:00 ` [PATCH 04/18] poison "public" Ondrej Oprala
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 15:58 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	Unbundle strutcures nested in union flds_bnds.
	* gdbtypes.h (union type_owner, union field_location, struct field)
	(struct range_bounds): Moved out from ...
	(struct main_type): ... here.
	(struct fn_field, struct fn_fieldlist, struct typedef_field):
	Moved out from ...
	(struct cplus_struct_type): ... here.
	(union call_site_parameter_u, struct call_site_parameter): Moved
	out from ...
	(struct call_site): ... here.
---
 gdb/gdbtypes.h | 436 +++++++++++++++++++++++++++++----------------------------
 1 file changed, 222 insertions(+), 214 deletions(-)

diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index d7fdedf..f8b2ec7 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -396,6 +396,91 @@ enum type_specific_kind
   TYPE_SPECIFIC_FUNC
 };
 
+union type_owner
+{
+  struct objfile *objfile;
+  struct gdbarch *gdbarch;
+};
+
+union field_location
+{
+  /* Position of this field, counting in bits from start of
+     containing structure.  For gdbarch_bits_big_endian=1
+     targets, it is the bit offset to the MSB.  For
+     gdbarch_bits_big_endian=0 targets, it is the bit offset to
+     the LSB.  */
+
+  int bitpos;
+
+  /* Enum value.  */
+  LONGEST enumval;
+
+  /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr
+     is the location (in the target) of the static field.
+     Otherwise, physname is the mangled label of the static field.  */
+
+  CORE_ADDR physaddr;
+  const char *physname;
+
+  /* The field location can be computed by evaluating the following DWARF
+     block.  Its DATA is allocated on objfile_obstack - no CU load is
+     needed to access it.  */
+
+  struct dwarf2_locexpr_baton *dwarf_block;
+};
+
+struct field
+{
+  union field_location loc;
+
+  /* For a function or member type, this is 1 if the argument is marked
+     artificial.  Artificial arguments should not be shown to the
+     user.  For TYPE_CODE_RANGE it is set if the specific bound is not
+     defined.  */
+  unsigned int artificial : 1;
+
+  /* Discriminant for union field_location.  */
+  ENUM_BITFIELD(field_loc_kind) loc_kind : 3;
+
+  /* Size of this field, in bits, or zero if not packed.
+     If non-zero in an array type, indicates the element size in
+     bits (used only in Ada at the moment).
+     For an unpacked field, the field's type's length
+     says how many bytes the field occupies.  */
+
+  unsigned int bitsize : 28;
+
+  /* In a struct or union type, type of this field.
+     In a function or member type, type of this argument.
+     In an array type, the domain-type of the array.  */
+
+  struct type *type;
+
+  /* Name of field, value or argument.
+     NULL for range bounds, array domains, and member function
+     arguments.  */
+
+  const char *name;
+};
+
+struct range_bounds
+{
+  /* Low bound of range.  */
+
+  LONGEST low;
+
+  /* High bound of range.  */
+
+  LONGEST high;
+
+  /* Flags indicating whether the values of low and high are
+     valid.  When true, the respective range value is
+     undefined.  Currently used only for FORTRAN arrays.  */
+
+  char low_undefined;
+  char high_undefined;
+};
+
 /* This structure is space-critical.
    Its layout has been tweaked to reduce the space used.  */
 
@@ -487,11 +572,7 @@ struct main_type
      major overhaul of the internal type system, it can't be avoided
      for now.  */
 
-  union type_owner
-    {
-      struct objfile *objfile;
-      struct gdbarch *gdbarch;
-    } owner;
+  union type_owner owner;
 
   /* For a pointer type, describes the type of object pointed to.
      For an array type, describes the type of the elements.
@@ -523,86 +604,11 @@ struct main_type
 
   union 
   {
-    struct field
-    {
-      union field_location
-      {
-	/* Position of this field, counting in bits from start of
-	   containing structure.  For gdbarch_bits_big_endian=1
-	   targets, it is the bit offset to the MSB.  For
-	   gdbarch_bits_big_endian=0 targets, it is the bit offset to
-	   the LSB.  */
-
-	int bitpos;
-
-	/* Enum value.  */
-	LONGEST enumval;
-
-	/* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr
-	   is the location (in the target) of the static field.
-	   Otherwise, physname is the mangled label of the static field.  */
-
-	CORE_ADDR physaddr;
-	const char *physname;
-
-	/* The field location can be computed by evaluating the following DWARF
-	   block.  Its DATA is allocated on objfile_obstack - no CU load is
-	   needed to access it.  */
-
-	struct dwarf2_locexpr_baton *dwarf_block;
-      }
-      loc;
-
-      /* For a function or member type, this is 1 if the argument is marked
-	 artificial.  Artificial arguments should not be shown to the
-	 user.  For TYPE_CODE_RANGE it is set if the specific bound is not
-	 defined.  */
-      unsigned int artificial : 1;
-
-      /* Discriminant for union field_location.  */
-      ENUM_BITFIELD(field_loc_kind) loc_kind : 3;
-
-      /* Size of this field, in bits, or zero if not packed.
-	 If non-zero in an array type, indicates the element size in
-	 bits (used only in Ada at the moment).
-	 For an unpacked field, the field's type's length
-	 says how many bytes the field occupies.  */
-
-      unsigned int bitsize : 28;
-
-      /* In a struct or union type, type of this field.
-	 In a function or member type, type of this argument.
-	 In an array type, the domain-type of the array.  */
-
-      struct type *type;
-
-      /* Name of field, value or argument.
-	 NULL for range bounds, array domains, and member function
-	 arguments.  */
-
-      const char *name;
-    } *fields;
+    struct field *fields;
 
     /* Union member used for range types.  */
 
-    struct range_bounds
-    {
-      /* Low bound of range.  */
-
-      LONGEST low;
-
-      /* High bound of range.  */
-
-      LONGEST high;
-
-      /* Flags indicating whether the values of low and high are
-         valid.  When true, the respective range value is
-         undefined.  Currently used only for FORTRAN arrays.  */
-           
-      char low_undefined;
-      char high_undefined;
-
-    } *bounds;
+    struct range_bounds *bounds;
 
   } flds_bnds;
 
@@ -711,6 +717,103 @@ struct type
 
 #define	NULL_TYPE ((struct type *) 0)
 
+struct fn_field
+{
+  /* If is_stub is clear, this is the mangled name which we can
+     look up to find the address of the method (FIXME: it would
+     be cleaner to have a pointer to the struct symbol here
+     instead).  */
+
+  /* If is_stub is set, this is the portion of the mangled
+     name which specifies the arguments.  For example, "ii",
+     if there are two int arguments, or "" if there are no
+     arguments.  See gdb_mangle_name for the conversion from this
+     format to the one used if is_stub is clear.  */
+
+  const char *physname;
+
+  /* The function type for the method.
+     (This comment used to say "The return value of the method",
+     but that's wrong.  The function type
+     is expected here, i.e. something with TYPE_CODE_FUNC,
+     and *not* the return-value type).  */
+
+  struct type *type;
+
+  /* For virtual functions.
+     First baseclass that defines this virtual function.  */
+
+  struct type *fcontext;
+
+  /* Attributes.  */
+
+  unsigned int is_const:1;
+  unsigned int is_volatile:1;
+  unsigned int is_private:1;
+  unsigned int is_protected:1;
+  unsigned int is_public:1;
+  unsigned int is_abstract:1;
+  unsigned int is_static:1;
+  unsigned int is_final:1;
+  unsigned int is_synchronized:1;
+  unsigned int is_native:1;
+  unsigned int is_artificial:1;
+
+  /* A stub method only has some fields valid (but they are enough
+     to reconstruct the rest of the fields).  */
+  unsigned int is_stub:1;
+
+  /* True if this function is a constructor, false
+     otherwise.  */
+  unsigned int is_constructor : 1;
+
+  /* Unused.  */
+  unsigned int dummy:3;
+
+  /* Index into that baseclass's virtual function table,
+     minus 2; else if static: VOFFSET_STATIC; else: 0.  */
+
+  unsigned int voffset:16;
+
+#define VOFFSET_STATIC 1
+
+};
+
+/* For classes, structures, and unions, a description of each field,
+   which consists of an overloaded name, followed by the types of
+   arguments that the method expects, and then the name after it
+   has been renamed to make it distinct.
+
+   fn_fieldlists points to an array of nfn_fields of these.  */
+
+struct fn_fieldlist
+{
+  /* The overloaded name.
+     This is generally allocated in the objfile's obstack.
+     However stabsread.c sometimes uses malloc.  */
+
+  const char *name;
+
+  /* The number of methods with this name.  */
+
+  int length;
+
+  /* The list of methods.  */
+
+  struct fn_field *fn_fields;
+};
+
+/* typedefs defined inside this class.  TYPEDEF_FIELD points to an array of
+   TYPEDEF_FIELD_COUNT elements.  */
+struct typedef_field
+{
+  /* Unqualified name to be prefixed by owning class qualified name.  */
+  const char *name;
+
+  /* Type this typedef named NAME represents.  */
+  struct type *type;
+};
+
 /* C++ language-specific information for TYPE_CODE_STRUCT and TYPE_CODE_UNION
    nodes.  */
 
@@ -775,106 +878,9 @@ struct cplus_struct_type
 
     B_TYPE *ignore_field_bits;
 
-    /* For classes, structures, and unions, a description of each field,
-       which consists of an overloaded name, followed by the types of
-       arguments that the method expects, and then the name after it
-       has been renamed to make it distinct.
-
-       fn_fieldlists points to an array of nfn_fields of these.  */
-
-    struct fn_fieldlist
-      {
-
-	/* The overloaded name.
-	   This is generally allocated in the objfile's obstack.
-	   However stabsread.c sometimes uses malloc.  */
-
-	const char *name;
-
-	/* The number of methods with this name.  */
-
-	int length;
-
-	/* The list of methods.  */
-
-	struct fn_field
-	  {
-
-	    /* If is_stub is clear, this is the mangled name which we can
-	       look up to find the address of the method (FIXME: it would
-	       be cleaner to have a pointer to the struct symbol here
-	       instead).  */
+    struct fn_fieldlist *fn_fieldlists;
 
-	    /* If is_stub is set, this is the portion of the mangled
-	       name which specifies the arguments.  For example, "ii",
-	       if there are two int arguments, or "" if there are no
-	       arguments.  See gdb_mangle_name for the conversion from this
-	       format to the one used if is_stub is clear.  */
-
-	    const char *physname;
-
-	    /* The function type for the method.
-	       (This comment used to say "The return value of the method",
-	       but that's wrong.  The function type 
-	       is expected here, i.e. something with TYPE_CODE_FUNC,
-	       and *not* the return-value type).  */
-
-	    struct type *type;
-
-	    /* For virtual functions.
-	       First baseclass that defines this virtual function.  */
-
-	    struct type *fcontext;
-
-	    /* Attributes.  */
-
-	    unsigned int is_const:1;
-	    unsigned int is_volatile:1;
-	    unsigned int is_private:1;
-	    unsigned int is_protected:1;
-	    unsigned int is_public:1;
-	    unsigned int is_abstract:1;
-	    unsigned int is_static:1;
-	    unsigned int is_final:1;
-	    unsigned int is_synchronized:1;
-	    unsigned int is_native:1;
-	    unsigned int is_artificial:1;
-
-	    /* A stub method only has some fields valid (but they are enough
-	       to reconstruct the rest of the fields).  */
-	    unsigned int is_stub:1;
-
-	    /* True if this function is a constructor, false
-	       otherwise.  */
-	    unsigned int is_constructor : 1;
-
-	    /* Unused.  */
-	    unsigned int dummy:3;
-
-	    /* Index into that baseclass's virtual function table,
-	       minus 2; else if static: VOFFSET_STATIC; else: 0.  */
-
-	    unsigned int voffset:16;
-
-#define VOFFSET_STATIC 1
-
-	  }
-	 *fn_fields;
-
-      }
-     *fn_fieldlists;
-
-    /* typedefs defined inside this class.  TYPEDEF_FIELD points to an array of
-       TYPEDEF_FIELD_COUNT elements.  */
-    struct typedef_field
-      {
-	/* Unqualified name to be prefixed by owning class qualified name.  */
-	const char *name;
-
-	/* Type this typedef named NAME represents.  */
-	struct type *type;
-      }
-    *typedef_field;
+    struct typedef_field *typedef_field;
     unsigned typedef_field_count;
 
     /* The template arguments.  This is an array with
@@ -943,6 +949,40 @@ enum call_site_parameter_kind
   CALL_SITE_PARAMETER_PARAM_OFFSET
 };
 
+union call_site_parameter_u
+{
+  /* DW_TAG_formal_parameter's DW_AT_location's DW_OP_regX as DWARF
+     register number, for register passed parameters.  */
+  int dwarf_reg;
+
+  /* Offset from the callee's frame base, for stack passed parameters.
+     This equals offset from the caller's stack pointer.  */
+  CORE_ADDR fb_offset;
+
+  /* Offset relative to the start of this PER_CU to
+     DW_TAG_formal_parameter which is referenced by both caller and
+     the callee.  */
+  cu_offset param_offset;
+};
+
+/* Describe DW_TAG_GNU_call_site's DW_TAG_formal_parameter.  */
+struct call_site_parameter
+{
+  ENUM_BITFIELD (call_site_parameter_kind) kind : 2;
+
+  union call_site_parameter_u u;
+
+  /* DW_TAG_formal_parameter's DW_AT_GNU_call_site_value.  It is never
+     NULL.  */
+  const gdb_byte *value;
+  size_t value_size;
+
+  /* DW_TAG_formal_parameter's DW_AT_GNU_call_site_data_value.  It may be
+     NULL if not provided by DWARF.  */
+  const gdb_byte *data_value;
+  size_t data_value_size;
+};
+
 /* A place where a function gets called from, represented by
    DW_TAG_GNU_call_site.  It can be looked up from symtab->call_site_htab.  */
 
@@ -973,39 +1013,7 @@ struct call_site
        blocks execution in the parameter array below.  */
     struct dwarf2_per_cu_data *per_cu;
 
-    /* Describe DW_TAG_GNU_call_site's DW_TAG_formal_parameter.  */
-    struct call_site_parameter
-      {
-	ENUM_BITFIELD (call_site_parameter_kind) kind : 2;
-
-	union call_site_parameter_u
-	  {
-	    /* DW_TAG_formal_parameter's DW_AT_location's DW_OP_regX as DWARF
-	       register number, for register passed parameters.  */
-	    int dwarf_reg;
-
-	    /* Offset from the callee's frame base, for stack passed parameters.
-	       This equals offset from the caller's stack pointer.  */
-	    CORE_ADDR fb_offset;
-
-	    /* Offset relative to the start of this PER_CU to
-	       DW_TAG_formal_parameter which is referenced by both caller and
-	       the callee.  */
-	    cu_offset param_offset;
-	  }
-	u;
-
-	/* DW_TAG_formal_parameter's DW_AT_GNU_call_site_value.  It is never
-	   NULL.  */
-	const gdb_byte *value;
-	size_t value_size;
-
-	/* DW_TAG_formal_parameter's DW_AT_GNU_call_site_data_value.  It may be
-	   NULL if not provided by DWARF.  */
-	const gdb_byte *data_value;
-	size_t data_value_size;
-      }
-    parameter[1];
+    struct call_site_parameter parameter[1];
   };
 
 /* The default value of TYPE_CPLUS_SPECIFIC(T) points to the
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 17/18] fix gdbarch buglet
  2013-10-21 15:37 ` [PATCH 17/18] fix gdbarch buglet Ondrej Oprala
@ 2013-10-21 16:00   ` Pedro Alves
  2013-10-22  6:20     ` Ondrej Oprala
  0 siblings, 1 reply; 23+ messages in thread
From: Pedro Alves @ 2013-10-21 16:00 UTC (permalink / raw)
  To: Ondrej Oprala; +Cc: gdb-patches, Tom Tromey

It looks like the patch is about implicit int <-> enum
conversions, which a C++ compiler would complain about.
But the subject talks about a buglet -- what's the bug this
fixes?

Please always include a rationale for a change in the body
of the email.

On 10/21/2013 04:37 PM, Ondrej Oprala wrote:
> From: Tom Tromey <tromey@redhat.com>
> 
> gdb/ChangeLog:
> 
> 2013-10-09  Tom Tromey  <tromey@redhat.com>
> 
> 	* gdbarch.c: Regenerate.
> 	(byte_order_for_code): Likewise.

This "Likewise" doesn't make sense when you read this
entry sequentially (as one should and will).

> 	(gdbarch_byte_order): Change type of the return value.
> 	(gdbarch_byte_order_for_code): Likewise.
> 	* gdbarch.h: Regenerate.
> 	* gdbarch.sh (byte_order): Change the return type.
> 	(byte_order_for_code): Likewise.

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 06/18] poison "delete"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (15 preceding siblings ...)
  2013-10-21 15:58 ` [PATCH 16/18] fix up gdbtypes.h Ondrej Oprala
@ 2013-10-21 16:11 ` Ondrej Oprala
  2013-10-21 17:00 ` [PATCH 04/18] poison "public" Ondrej Oprala
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 16:11 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* gdb/ui-file.h (delete_ptr): Renamed from delete.
---
 gdb/ui-file.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/ui-file.h b/gdb/ui-file.h
index ba0a908..16468e8 100644
--- a/gdb/ui-file.h
+++ b/gdb/ui-file.h
@@ -77,7 +77,7 @@ extern void set_ui_file_put (struct ui_file *stream, ui_file_put_ftype *put);
 
 typedef void (ui_file_delete_ftype) (struct ui_file * stream);
 extern void set_ui_file_data (struct ui_file *stream, void *data,
-			      ui_file_delete_ftype *delete);
+			      ui_file_delete_ftype *delete_ptr);
 
 typedef int (ui_file_fseek_ftype) (struct ui_file *stream, long offset,
 				   int whence);
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 04/18] poison "public"
  2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
                   ` (16 preceding siblings ...)
  2013-10-21 16:11 ` [PATCH 06/18] poison "delete" Ondrej Oprala
@ 2013-10-21 17:00 ` Ondrej Oprala
  17 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-21 17:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

gdb/ChangeLog

2013-10-21  Tom Tromey  <tromey@redhat.com>

	* gdbtypes.c (public_flag): Renamed from public.
---
 gdb/gdbtypes.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index bbac3c6..c09c9f3 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -2154,7 +2154,7 @@ class_types_same_p (const struct type *a, const struct type *b)
    distance_to_ancestor (A, D, 1) = -1.  */
 
 static int
-distance_to_ancestor (struct type *base, struct type *dclass, int public)
+distance_to_ancestor (struct type *base, struct type *dclass, int public_flag)
 {
   int i;
   int d;
@@ -2167,10 +2167,10 @@ distance_to_ancestor (struct type *base, struct type *dclass, int public)
 
   for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
     {
-      if (public && ! BASETYPE_VIA_PUBLIC (dclass, i))
+      if (public_flag && ! BASETYPE_VIA_PUBLIC (dclass, i))
 	continue;
 
-      d = distance_to_ancestor (base, TYPE_BASECLASS (dclass, i), public);
+      d = distance_to_ancestor (base, TYPE_BASECLASS (dclass, i), public_flag);
       if (d >= 0)
 	return 1 + d;
     }
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 17/18] fix gdbarch buglet
  2013-10-21 16:00   ` Pedro Alves
@ 2013-10-22  6:20     ` Ondrej Oprala
  0 siblings, 0 replies; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-22  6:20 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Tom Tromey

On 10/21/2013 06:00 PM, Pedro Alves wrote:
> It looks like the patch is about implicit int <-> enum
> conversions, which a C++ compiler would complain about.
> But the subject talks about a buglet -- what's the bug this
> fixes?
I'm not entirely sure TBH, this is the subject Tom gave it,
so he can probably tell us more.
>
> Please always include a rationale for a change in the body
> of the email.
>
> On 10/21/2013 04:37 PM, Ondrej Oprala wrote:
>> From: Tom Tromey <tromey@redhat.com>
>>
>> gdb/ChangeLog:
>>
>> 2013-10-09  Tom Tromey  <tromey@redhat.com>
>>
>> 	* gdbarch.c: Regenerate.
>> 	(byte_order_for_code): Likewise.
> This "Likewise" doesn't make sense when you read this
> entry sequentially (as one should and will).
My bad, that line should have been omitted, as should
the others under regenerated files (fixed below).
>
>> 	(gdbarch_byte_order): Change type of the return value.
>> 	(gdbarch_byte_order_for_code): Likewise.
>> 	* gdbarch.h: Regenerate.
>> 	* gdbarch.sh (byte_order): Change the return type.
>> 	(byte_order_for_code): Likewise.

From: Tom Tromey<tromey@redhat.com>

gdb/ChangeLog

2013-10-09  Tom Tromey<tromey@redhat.com>

	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
	* gdbarch.sh (byte_order): Change the return type.
	(byte_order_for_code): Likewise.
---
  gdb/gdbarch.c  | 8 ++++----
  gdb/gdbarch.h  | 4 ++--
  gdb/gdbarch.sh | 4 ++--
  3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 396bb67..3b82605 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -99,8 +99,8 @@ struct gdbarch
  
    /* basic architectural information.  */
    const struct bfd_arch_info * bfd_arch_info;
-  int byte_order;
-  int byte_order_for_code;
+  enum bfd_endian byte_order;
+  enum bfd_endian byte_order_for_code;
    enum gdb_osabi osabi;
    const struct target_desc * target_desc;
  
@@ -1444,7 +1444,7 @@ gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
    return gdbarch->bfd_arch_info;
  }
  
-int
+enum bfd_endian
  gdbarch_byte_order (struct gdbarch *gdbarch)
  {
    gdb_assert (gdbarch != NULL);
@@ -1453,7 +1453,7 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
    return gdbarch->byte_order;
  }
  
-int
+enum bfd_endian
  gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
  {
    gdb_assert (gdbarch != NULL);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index b58efc8..92e3ddf 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -91,10 +91,10 @@ typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
  extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
  /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized.  */
  
-extern int gdbarch_byte_order (struct gdbarch *gdbarch);
+extern enum bfd_endian gdbarch_byte_order (struct gdbarch *gdbarch);
  /* set_gdbarch_byte_order() - not applicable - pre-initialized.  */
  
-extern int gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
+extern enum bfd_endian gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
  /* set_gdbarch_byte_order_for_code() - not applicable - pre-initialized.  */
  
  extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index fa9731d..2fe535e 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -340,8 +340,8 @@ function_list ()
    cat <<EOF
  i:const struct bfd_arch_info *:bfd_arch_info:::&bfd_default_arch_struct::::gdbarch_bfd_arch_info (gdbarch)->printable_name
  #
-i:int:byte_order:::BFD_ENDIAN_BIG
-i:int:byte_order_for_code:::BFD_ENDIAN_BIG
+i:enum bfd_endian:byte_order:::BFD_ENDIAN_BIG
+i:enum bfd_endian:byte_order_for_code:::BFD_ENDIAN_BIG
  #
  i:enum gdb_osabi:osabi:::GDB_OSABI_UNKNOWN
  #
-- 1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 04/18] poison "public"
  2013-10-09 17:18 ` [PATCH 04/18] poison "public" Ondrej Oprala
@ 2013-10-13 16:39   ` Jan Kratochvil
  0 siblings, 0 replies; 23+ messages in thread
From: Jan Kratochvil @ 2013-10-13 16:39 UTC (permalink / raw)
  To: Ondrej Oprala; +Cc: gdb-patches, Tom Tromey

On Wed, 09 Oct 2013 19:17:19 +0200, Ondrej Oprala wrote:
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -17,6 +17,10 @@
>  
>  2013-10-09  Tom Tromey  <tromey@redhat.com>
>  
> + * gdbtypes.c (is_public): Renamed from public.

It should use tab for indentation.  But according to the "addrmap.c" text
below your on-disk file is probably right but it just got corrupted by mail.
Therefore mail it differently, please.

You should put function name in parentheses.  Therefore:
	* gdbtypes.c (distance_to_ancestor): Rename parameter public to
	is_public.

But I disagree with "is_public", it does not have such meaning in this
function.  One could use for example "public_only", "require_public" or
"traverse_public" here.  Function-independent could be "public_flag".


> +
> +2013-10-09  Tom Tromey  <tromey@redhat.com>
> +
>   * addrmap.c (self) : Renamed from this.
>   * cp-namespace.c (this_sym) : Likewise.
>   * frame.c (self) : Likewise.
[...]


Thanks,
Jan

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 04/18] poison "public"
  2013-10-09 17:17 [PATCH 00/18] -Wc++-compat patches Ondrej Oprala
@ 2013-10-09 17:18 ` Ondrej Oprala
  2013-10-13 16:39   ` Jan Kratochvil
  0 siblings, 1 reply; 23+ messages in thread
From: Ondrej Oprala @ 2013-10-09 17:18 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

From: Tom Tromey <tromey@redhat.com>

        * gdbtypes.c (is_public): Renamed from public.
---
 gdb/ChangeLog  | 4 ++++
 gdb/gdbtypes.c | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index be3cf66..93e30e5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -17,6 +17,10 @@
 
 2013-10-09  Tom Tromey  <tromey@redhat.com>
 
+ * gdbtypes.c (is_public): Renamed from public.
+
+2013-10-09  Tom Tromey  <tromey@redhat.com>
+
  * addrmap.c (self) : Renamed from this.
  * cp-namespace.c (this_sym) : Likewise.
  * frame.c (self) : Likewise.
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index e32cf97..592e142 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -2139,7 +2139,7 @@ class_types_same_p (const struct type *a, const struct type *b)
    distance_to_ancestor (A, D, 1) = -1.  */
 
 static int
-distance_to_ancestor (struct type *base, struct type *dclass, int public)
+distance_to_ancestor (struct type *base, struct type *dclass, int is_public)
 {
   int i;
   int d;
@@ -2152,10 +2152,10 @@ distance_to_ancestor (struct type *base, struct type *dclass, int public)
 
   for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
     {
-      if (public && ! BASETYPE_VIA_PUBLIC (dclass, i))
+      if (is_public && ! BASETYPE_VIA_PUBLIC (dclass, i))
 	continue;
 
-      d = distance_to_ancestor (base, TYPE_BASECLASS (dclass, i), public);
+      d = distance_to_ancestor (base, TYPE_BASECLASS (dclass, i), is_public);
       if (d >= 0)
 	return 1 + d;
     }
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-10-22  6:20 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
2013-10-21 15:37 ` [PATCH 17/18] fix gdbarch buglet Ondrej Oprala
2013-10-21 16:00   ` Pedro Alves
2013-10-22  6:20     ` Ondrej Oprala
2013-10-21 15:37 ` [PATCH 13/18] poison "typename" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 15/18] fix up vec Ondrej Oprala
2013-10-21 15:37 ` [PATCH 01/18] poison "class" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 09/18] poison "namespace" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 11/18] poison "template" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 18/18] un-nest enum pvk Ondrej Oprala
2013-10-21 15:37 ` [PATCH 07/18] poison "explicit" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 05/18] poison "private" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 02/18] poison "new" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 10/18] poison "operator" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 12/18] poison "try" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 03/18] poison "this" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 14/18] poison "using" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 08/18] poison "mutable" Ondrej Oprala
2013-10-21 15:58 ` [PATCH 16/18] fix up gdbtypes.h Ondrej Oprala
2013-10-21 16:11 ` [PATCH 06/18] poison "delete" Ondrej Oprala
2013-10-21 17:00 ` [PATCH 04/18] poison "public" Ondrej Oprala
  -- strict thread matches above, loose matches on Subject: below --
2013-10-09 17:17 [PATCH 00/18] -Wc++-compat patches Ondrej Oprala
2013-10-09 17:18 ` [PATCH 04/18] poison "public" Ondrej Oprala
2013-10-13 16:39   ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).