This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[OB] remote.c: initialize p to handle build error
- From: Hui Zhu <teawater at gmail dot com>
- To: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Thu, 14 Jul 2011 12:48:54 +0800
- Subject: [OB] remote.c: initialize p to handle build error
gcc -g -O2 -I. -I../../src/gdb -I../../src/gdb/common
-I../../src/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\""
-DHAVE_CONFIG_H -I../../src/gdb/../include/opcode
-I../../src/gdb/../opcodes/.. -I../../src/gdb/../readline/.. -I../bfd
-I../../src/gdb/../bfd -I../../src/gdb/../include -I../libdecnumber
-I../../src/gdb/../libdecnumber -I../../src/gdb/gnulib -Ignulib
-DTUI=1 -DGDBTK -I/usr/include/python2.6 -I/usr/include/python2.6
-Wall -Wdeclaration-after-statement -Wpointer-arith
-Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wunused-value
-Wunused-function -Wno-switch -Wno-char-subscripts -Werror -c -o
remote.o -MT remote.o -MMD -MP -MF .deps/remote.Tpo
../../src/gdb/remote.c
cc1: warnings being treated as errors
../../src/gdb/remote.c: In function ‘remote_get_trace_status’:
../../src/gdb/remote.c:10045:9: error: ‘p’ may be used uninitialized
in this function
Checked in a patch to fix it.
Thanks,
Hui
2011-07-14 Hui Zhu <teawater@gmail.com>
* remote.c (remote_get_trace_status): Initialize p.
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.455
retrieving revision 1.456
diff -u -r1.455 -r1.456
--- src/gdb/remote.c 2011/07/13 17:07:16 1.455
+++ src/gdb/remote.c 2011/07/14 04:46:42 1.456
@@ -10042,7 +10042,7 @@
static int
remote_get_trace_status (struct trace_status *ts)
{
- char *p;
+ char *p = NULL;
/* FIXME we need to get register block size some other way. */
extern int trace_regblock_size;
volatile struct gdb_exception ex;