This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

Re: FYI: fix uninitialized variable in converts.cc test


>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Tom> 	* gdb.cp/converts.cc (main): Initialize 'a'.

Oops, I mailed out a the non-working patch.
Here's the one I am actually committing.

Tom

Index: gdb.cp/converts.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/converts.cc,v
retrieving revision 1.7
diff -u -r1.7 converts.cc
--- gdb.cp/converts.cc	16 Sep 2012 17:30:48 -0000	1.7
+++ gdb.cp/converts.cc	23 Jan 2013 20:31:41 -0000
@@ -53,7 +53,8 @@
 //foo0_3(bppp); // Pointer-to-pointer-to-pointer base.
   foo0_3((A***)bppp); // to ensure that the function is emitted.
 
-  char *a;             // pointer to..
+  char av = 'a';
+  char *a = &av;       // pointer to..
   B *bp;
   foo1_1 (a);          // ..pointer
   foo1_2 (a);          // ..array


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