aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-08-21 23:49:37 +0100
committerPedro Alves <palves@redhat.com>2015-08-21 23:49:37 +0100
commitf8904751117dc8d4d04e5c5286b71b854e6ebba5 (patch)
treedef38f1d522d2bbc5622b50ae976cee9b97868e6 /gdb
parent049412e38f9ac04654940173db63a37ebca9bfc3 (diff)
downloadgdb-f8904751117dc8d4d04e5c5286b71b854e6ebba5.zip
gdb-f8904751117dc8d4d04e5c5286b71b854e6ebba5.tar.gz
gdb-f8904751117dc8d4d04e5c5286b71b854e6ebba5.tar.bz2
C++: Initialize a couple const globals
In C++ mode, we get: src/gdb/gdbserver/tdesc.c:43:33: error: uninitialized const ‘default_description’ [-fpermissive] static const struct target_desc default_description; ^ In file included from src/gdb/gdbserver/tdesc.c:19:0: src/gdb/gdbserver/tdesc.h:26:8: note: ‘const struct target_desc’ has no user-provided default constructor struct target_desc ^ gdb/ChangeLog: 2015-08-21 Pedro Alves <palves@redhat.com> * frame.c (null_frame_id): Explicitly zero-initialize. gdb/gdbserver/ChangeLog: 2015-08-21 Pedro Alves <palves@redhat.com> * tdesc.c (default_description): Explicitly zero-initialize.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/frame.c2
-rw-r--r--gdb/gdbserver/ChangeLog4
-rw-r--r--gdb/gdbserver/tdesc.c2
4 files changed, 10 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e99ec92..94bb7a5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2015-08-21 Pedro Alves <palves@redhat.com>
+
+ * frame.c (null_frame_id): Explicitly zero-initialize.
+
2015-08-21 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (struct dwarf2_section_info): Rename field
diff --git a/gdb/frame.c b/gdb/frame.c
index f05f739..745e007 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -503,7 +503,7 @@ frame_unwind_caller_id (struct frame_info *next_frame)
return null_frame_id;
}
-const struct frame_id null_frame_id; /* All zeros. */
+const struct frame_id null_frame_id = { 0 }; /* All zeros. */
const struct frame_id outer_frame_id = { 0, 0, 0, FID_STACK_INVALID, 0, 1, 0 };
struct frame_id
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index a11461d..6103287 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,9 @@
2015-08-21 Pedro Alves <palves@redhat.com>
+ * tdesc.c (default_description): Explicitly zero-initialize.
+
+2015-08-21 Pedro Alves <palves@redhat.com>
+
PR gdb/18749
* inferiors.c (remove_thread): Discard any pending stop reply for
this thread.
diff --git a/gdb/gdbserver/tdesc.c b/gdb/gdbserver/tdesc.c
index 8d008fd..1263efe 100644
--- a/gdb/gdbserver/tdesc.c
+++ b/gdb/gdbserver/tdesc.c
@@ -40,7 +40,7 @@ init_target_desc (struct target_desc *tdesc)
#ifndef IN_PROCESS_AGENT
-static const struct target_desc default_description;
+static const struct target_desc default_description = { 0 };
void
copy_target_description (struct target_desc *dest,