This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/7] Add cast to exception_none
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 28 Oct 2015 14:59:17 +0000
- Subject: [PATCH 2/7] Add cast to exception_none
- Authentication-results: sourceware.org; auth=none
- References: <1446044362-8655-1-git-send-email-palves at redhat dot com>
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-27 Pedro Alves <palves@redhat.com>
* common/common-exceptions.c (exception_none): Add cast.
---
gdb/common/common-exceptions.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
--
1.9.3