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]

FYI: fix uninitialized variable in converts.cc test


I'm checking this in.

testsuite/gdb.cp/converts.cc has:

  char *a;             // pointer to..
[... nothing changes 'a' ...]
  foo1_7 (*a);			// char to boolean

This doesn't seem to cause problems for me locally, but it caused the
test case to crash on HPUX, resulting in some spurious test failures.

The fix is to initialize the pointer.

Tested on x86-64 Fedora 16, also HPUX.

Tom

	* gdb.cp/converts.cc (main): Initialize 'a'.
---
 gdb/testsuite/gdb.cp/converts.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdb/testsuite/gdb.cp/converts.cc b/gdb/testsuite/gdb.cp/converts.cc
index 309008f..8a93191 100644
--- a/gdb/testsuite/gdb.cp/converts.cc
+++ b/gdb/testsuite/gdb.cp/converts.cc
@@ -53,7 +53,7 @@ int main()
 //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 *a = "a";       // pointer to..
   B *bp;
   foo1_1 (a);          // ..pointer
   foo1_2 (a);          // ..array
-- 
1.7.7.6


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