This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix uninitialised variable warning
- From: Geoffrey Keating <gkeating at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Fri, 11 Apr 2003 20:51:08 -0700 (PDT)
- Subject: Fix uninitialised variable warning
As far as I can see, the warning here is completely legitimate;
'checksum' really could be used uninitialised given suitably corrupt
profiling information.
This takes us to the end of stage2 on powerpc-darwin.
--
- Geoffrey Keating <geoffk at apple dot com>
===File ~/patches/gcc-checksumwarnfix.patch=================
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.17409
diff -u -p -u -p -r1.17409 ChangeLog
--- ChangeLog 12 Apr 2003 02:54:21 -0000 1.17409
+++ ChangeLog 12 Apr 2003 03:50:34 -0000
@@ -1,5 +1,7 @@
2003-04-11 Geoffrey Keating <geoffk at apple dot com>
+ * profile.c (read_counts_file): Initialise 'checksum'.
+
* emit-rtl.c (gen_rtx): Really correct typo.
PR c++/9393
Index: profile.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/profile.c,v
retrieving revision 1.113
diff -u -p -u -p -r1.113 profile.c
--- profile.c 11 Apr 2003 19:45:32 -0000 1.113
+++ profile.c 12 Apr 2003 03:50:34 -0000
@@ -274,7 +274,7 @@ static void
read_counts_file (const char *name)
{
char *function_name_buffer = NULL;
- unsigned version, ix, checksum;
+ unsigned version, ix, checksum = -1;
counts_entry_t *summaried = NULL;
unsigned seen_summary = 0;
============================================================