This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix C++ build errors on OpenBSD
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Mon, 16 Nov 2015 11:04:25 -0500
- Subject: [PATCH] Fix C++ build errors on OpenBSD
- Authentication-results: sourceware.org; auth=none
Fixes two instances of:
/root/binutils-gdb/gdb/cp-namespace.c: In function 'block_symbol cp_lookup_nested_symbol(type*, const char*, const block*, domain_enum)':
/root/binutils-gdb/gdb/cp-namespace.c:1010: warning: jump to case label
/root/binutils-gdb/gdb/cp-namespace.c:1008: error: crosses initialization of 'block_symbol <anonymous>'
Compiler info:
Reading specs from /usr/lib/gcc-lib/amd64-unknown-openbsd5.8/4.2.1/specs
Target: amd64-unknown-openbsd5.8
Configured with: OpenBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070719
gdb/ChangeLog:
* cp-namespace.c (cp_lookup_nested_symbol): Add curly braces in switch
case.
* d-namespace.c (d_lookup_nested_symbol): Likewise.
---
gdb/cp-namespace.c | 16 +++++++++-------
gdb/d-namespace.c | 4 +++-
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 989544b..d74cb92 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -999,13 +999,15 @@ cp_lookup_nested_symbol (struct type *parent_type,
case TYPE_CODE_FUNC:
case TYPE_CODE_METHOD:
- if (symbol_lookup_debug)
- {
- fprintf_unfiltered (gdb_stdlog,
- "cp_lookup_nested_symbol (...) = NULL"
- " (func/method)\n");
- }
- return (struct block_symbol) {NULL, NULL};
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_nested_symbol (...) = NULL"
+ " (func/method)\n");
+ }
+ return (struct block_symbol) {NULL, NULL};
+ }
default:
internal_error (__FILE__, __LINE__,
diff --git a/gdb/d-namespace.c b/gdb/d-namespace.c
index e8f4c6f..a59a7c5 100644
--- a/gdb/d-namespace.c
+++ b/gdb/d-namespace.c
@@ -370,7 +370,9 @@ d_lookup_nested_symbol (struct type *parent_type,
case TYPE_CODE_FUNC:
case TYPE_CODE_METHOD:
- return (struct block_symbol) {NULL, NULL};
+ {
+ return (struct block_symbol) {NULL, NULL};
+ }
default:
gdb_assert_not_reached ("called with non-aggregate type.");
--
2.5.1