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]

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


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