public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: [gcc-in-cxx] FYI: initialize consts
Date: Sun, 05 Oct 2008 17:08:00 -0000	[thread overview]
Message-ID: <m3vdw7c7zc.fsf@fleche.redhat.com> (raw)

I'm checking this in on the gcc-in-cxx branch.

g++ was complaining about uninitialized consts.
This patch fixes the two instances of that error.

Tom

ChangeLog:
2008-10-05  Tom Tromey  <tromey@redhat.com>

	* sdbout.c (sdb_debug_hooks): Initialize.
	* ggc-page.c (ggc_pch_write_object): Initialize emptyBytes.

Index: sdbout.c
===================================================================
--- sdbout.c	(revision 140884)
+++ sdbout.c	(working copy)
@@ -1,6 +1,6 @@
 /* Output sdb-format symbol table information from GNU compiler.
    Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -1687,7 +1687,35 @@
 #else  /* SDB_DEBUGGING_INFO */
 
 /* This should never be used, but its address is needed for comparisons.  */
-const struct gcc_debug_hooks sdb_debug_hooks;
+const struct gcc_debug_hooks sdb_debug_hooks =
+{
+  0,					 /* init */
+  0,					 /* finish */
+  0,					 /* define */
+  0,					 /* undef */
+  0,					 /* start_source_file */
+  0,					 /* end_source_file */
+  0,					 /* begin_block */
+  0,					 /* end_block */
+  0,					 /* ignore_block */
+  0,					 /* source_line */
+  0,					 /* begin_prologue */
+  0,					 /* end_prologue */
+  0,					 /* end_epilogue */
+  0,					 /* begin_function */
+  0,					 /* end_function */
+  0,					 /* function_decl */
+  0,					 /* global_decl */
+  0,					 /* type_decl */
+  0,					 /* imported_module_or_decl */
+  0,					 /* deferred_inline_function */
+  0,					 /* outlining_inline_function */
+  0,					 /* label */
+  0,					 /* handle_pch */
+  0,					 /* var_location */
+  0,					 /* switch_text_section */
+  0                                      /* start_end_main_source_file */
+};
 
 #endif /* SDB_DEBUGGING_INFO */
 
Index: ggc-page.c
===================================================================
--- ggc-page.c	(revision 140884)
+++ ggc-page.c	(working copy)
@@ -2160,7 +2160,7 @@
 		      size_t size, bool is_string ATTRIBUTE_UNUSED)
 {
   unsigned order;
-  static const char emptyBytes[256];
+  static const char emptyBytes[256] = { 0 };
 
   if (size < NUM_SIZE_LOOKUP)
     order = size_lookup[size];

                 reply	other threads:[~2008-10-05 16:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3vdw7c7zc.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).