This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gcc-in-cxx] FYI: initialize consts


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];


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]