Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [OB] remote.c: initialize p to handle build error
@ 2011-07-14  6:22 Hui Zhu
  2011-07-14 15:57 ` Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: Hui Zhu @ 2011-07-14  6:22 UTC (permalink / raw)
  To: gdb-patches ml

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;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OB] remote.c: initialize p to handle build error
  2011-07-14  6:22 [OB] remote.c: initialize p to handle build error Hui Zhu
@ 2011-07-14 15:57 ` Jan Kratochvil
  2011-07-15  9:03   ` Hui Zhu
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2011-07-14 15:57 UTC (permalink / raw)
  To: Hui Zhu; +Cc: gdb-patches ml

On Thu, 14 Jul 2011 06:48:54 +0200, Hui Zhu wrote:
> 	* remote.c (remote_get_trace_status): Initialize p.

Also for 7.3; although it does not use -Werror.

BTW there are sometimes comments in these cases like:
	/* Initialize it just to avoid a GCC false warning.  */


Thanks/sorry,
Jan


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OB] remote.c: initialize p to handle build error
  2011-07-14 15:57 ` Jan Kratochvil
@ 2011-07-15  9:03   ` Hui Zhu
  0 siblings, 0 replies; 3+ messages in thread
From: Hui Zhu @ 2011-07-15  9:03 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches ml

Hi Jan,

Thanks for your help.

Checked in according to your mail.
http://sourceware.org/ml/gdb-cvs/2011-07/msg00141.html
http://sourceware.org/ml/gdb-cvs/2011-07/msg00142.html

Best,
Hui

On Thu, Jul 14, 2011 at 22:59, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> On Thu, 14 Jul 2011 06:48:54 +0200, Hui Zhu wrote:
>>       * remote.c (remote_get_trace_status): Initialize p.
>
> Also for 7.3; although it does not use -Werror.
>
> BTW there are sometimes comments in these cases like:
>        /* Initialize it just to avoid a GCC false warning.  */
>
>
> Thanks/sorry,
> Jan
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-15  2:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-14  6:22 [OB] remote.c: initialize p to handle build error Hui Zhu
2011-07-14 15:57 ` Jan Kratochvil
2011-07-15  9:03   ` Hui Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox