This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Add cast to exception_none
- From: Pedro Alves <palves at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 29 Oct 2015 12:56:57 -0000
- Subject: [binutils-gdb] Add cast to exception_none
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=44a8b4df1d6f5b8096f01787751fd51c42e78fc6
commit 44a8b4df1d6f5b8096f01787751fd51c42e78fc6
Author: Pedro Alves <palves@redhat.com>
Date: Thu Oct 29 12:55:01 2015 +0000
Add cast to exception_none
Fixes, in C++ mode:
../../src/gdb/common/common-exceptions.c:23:69: error: invalid conversion from â??intâ?? to â??return_reasonâ?? [-fpermissive]
const struct gdb_exception exception_none = { 0, GDB_NO_ERROR, NULL };
^
(I considered adding an enum value for '0', but the code and comments
around return_reason and its uses explain how 0 is special/internal,
so I'm leaving it be.)
gdb/ChangeLog:
2015-10-29 Pedro Alves <palves@redhat.com>
* common/common-exceptions.c (exception_none): Add cast.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/common/common-exceptions.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0bb06ae..66f6dd6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2015-10-29 Pedro Alves <palves@redhat.com>
+ * common/common-exceptions.c (exception_none): Add cast.
+
+2015-10-29 Pedro Alves <palves@redhat.com>
+
* compile/compile-c-types.c (struct type_map_instance)
<gcc_type>: Rename to gcc_type_handle.
(insert_type, convert_type): Adjust.
diff --git a/gdb/common/common-exceptions.c b/gdb/common/common-exceptions.c
index 8ee96ab..ce476a2 100644
--- a/gdb/common/common-exceptions.c
+++ b/gdb/common/common-exceptions.c
@@ -20,7 +20,7 @@
#include "common-defs.h"
#include "common-exceptions.h"
-const struct gdb_exception exception_none = { 0, GDB_NO_ERROR, NULL };
+const struct gdb_exception exception_none = { (enum return_reason) 0, GDB_NO_ERROR, NULL };
#ifndef __cplusplus