This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] gnu-v2-abi.c: Add casts
- From: Pedro Alves <palves at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 29 Oct 2015 17:24:36 -0000
- Subject: [binutils-gdb] gnu-v2-abi.c: Add casts
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ebf05345dadb3fcb232cb788a9126e563f6bb767
commit ebf05345dadb3fcb232cb788a9126e563f6bb767
Author: Pedro Alves <palves@redhat.com>
Date: Thu Oct 29 17:23:34 2015 +0000
gnu-v2-abi.c: Add casts
I looked at changing these is_destructor_name/is_constructor_name
interfaces in order to detangle the boolean result from the ctor/dtor
kind return, but then realized that this design goes all the way down
to the libiberty demangler interfaces. E.g, include/demangle.h:
~~~
/* Return non-zero iff NAME is the mangled form of a constructor name
in the G++ V3 ABI demangling style. Specifically, return an `enum
gnu_v3_ctor_kinds' value indicating what kind of constructor
it is. */
extern enum gnu_v3_ctor_kinds
is_gnu_v3_mangled_ctor (const char *name);
enum gnu_v3_dtor_kinds {
gnu_v3_deleting_dtor = 1,
gnu_v3_complete_object_dtor,
gnu_v3_base_object_dtor,
/* These are not part of the V3 ABI. Unified destructors are generated
as a speed-for-space optimization when the -fdeclone-ctor-dtor option
is used, and are always internal symbols. */
gnu_v3_unified_dtor,
gnu_v3_object_dtor_group
};
~~~
libiberty/cp-demangle.c:
~~~
enum gnu_v3_ctor_kinds
is_gnu_v3_mangled_ctor (const char *name)
{
enum gnu_v3_ctor_kinds ctor_kind;
enum gnu_v3_dtor_kinds dtor_kind;
if (! is_ctor_or_dtor (name, &ctor_kind, &dtor_kind))
return (enum gnu_v3_ctor_kinds) 0;
return ctor_kind;
}
~~~
etc.
gdb/ChangeLog:
2015-10-29 Pedro Alves <palves@redhat.com>
* gnu-v2-abi.c (gnuv2_is_destructor_name)
(gnuv2_is_constructor_name): Add casts.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/gnu-v2-abi.c | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 66f6dd6..84fa773 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2015-10-29 Pedro Alves <palves@redhat.com>
+ * gnu-v2-abi.c (gnuv2_is_destructor_name)
+ (gnuv2_is_constructor_name): Add casts.
+
+2015-10-29 Pedro Alves <palves@redhat.com>
+
* common/common-exceptions.c (exception_none): Add cast.
2015-10-29 Pedro Alves <palves@redhat.com>
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
index c508b55..6c2b92a 100644
--- a/gdb/gnu-v2-abi.c
+++ b/gdb/gnu-v2-abi.c
@@ -40,7 +40,7 @@ gnuv2_is_destructor_name (const char *name)
|| startswith (name, "__dt__"))
return complete_object_dtor;
else
- return 0;
+ return (enum dtor_kinds) 0;
}
static enum ctor_kinds
@@ -51,7 +51,7 @@ gnuv2_is_constructor_name (const char *name)
|| startswith (name, "__ct__"))
return complete_object_ctor;
else
- return 0;
+ return (enum ctor_kinds) 0;
}
static int