* [gcc-in-cxx] FYI: initialize consts
@ 2008-10-05 17:08 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2008-10-05 17:08 UTC (permalink / raw)
To: Gcc Patch List
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];
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-10-05 16:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-05 17:08 [gcc-in-cxx] FYI: initialize consts Tom Tromey
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).