This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[python] [commit] Fix compilation warning.


commit 7a55ecda83dff08a0f371947c5f9515184c02d8d
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Thu Jan 14 02:17:52 2010 +0100

gcc-4.4.2-20.fc12.x86_64 started to error out on:
gdbtypes.c: In function ‘delete_main_type’:
gdbtypes.c:3149: error: the address of ‘cplus_struct_default’ will always evaluate as ‘true’

It would be possible to fix it by:
-  gdb_assert (!HAVE_CPLUS_STRUCT (type) || !TYPE_CPLUS_SPECIFIC (type));
+  gdb_assert (!HAVE_CPLUS_STRUCT (type) || TYPE_CPLUS_SPECIFIC (type) == NULL);

But at the same due since the introduction of TYPE_SPECIFIC_CPLUS_STUFF by
	Re: [RFA/DWARF] Add DW_AT_GNAT_descriptive_type support
	http://sourceware.org/ml/gdb-patches/2010-01/msg00243.html

TYPE_CPLUS_SPECIFIC can no longer ever be NULL and therefore this conditional
can be removed.

Another point is that there should be now rather:
  gdb_assert (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_NONE)
as none of the extensions is supported but this garbage collecting code is
currently not in use anyway.

No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.

	* gdbtypes.c (delete_main_type): Remove !TYPE_CPLUS_SPECIFIC assertion.
---
 gdb/gdbtypes.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 92a8980..2689ad3 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -3144,9 +3144,7 @@ delete_main_type (struct type *type, htab_t deleted_types)
     }
   xfree (TYPE_FIELDS (type));
 
-  /* Strangely, HAVE_CPLUS_STRUCT will return true when there isn't
-     one at all.  */
-  gdb_assert (!HAVE_CPLUS_STRUCT (type) || !TYPE_CPLUS_SPECIFIC (type));
+  gdb_assert (!HAVE_CPLUS_STRUCT (type));
 
   xfree (TYPE_MAIN_TYPE (type));
 }
-- 
1.6.5.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]