From patchwork Fri Aug 21 22:50:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 8387 Received: (qmail 7983 invoked by alias); 21 Aug 2015 22:50:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 7974 invoked by uid 89); 21 Aug 2015 22:50:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_05, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 21 Aug 2015 22:50:38 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 5EA49A2C35 for ; Fri, 21 Aug 2015 22:50:37 +0000 (UTC) Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7LMoaQw021917 for ; Fri, 21 Aug 2015 18:50:36 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [ob/pushed] C++: Initialize a couple const globals Date: Fri, 21 Aug 2015 23:50:35 +0100 Message-Id: <1440197435-23948-1-git-send-email-palves@redhat.com> MIME-Version: 1.0 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 * frame.c (null_frame_id): Explicitly zero-initialize. gdb/gdbserver/ChangeLog: 2015-08-21 Pedro Alves * tdesc.c (default_description): Explicitly zero-initialize. --- gdb/ChangeLog | 4 ++++ gdb/frame.c | 2 +- gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/tdesc.c | 2 +- 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 + + * frame.c (null_frame_id): Explicitly zero-initialize. + 2015-08-21 Tom Tromey * 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 + * tdesc.c (default_description): Explicitly zero-initialize. + +2015-08-21 Pedro Alves + 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,