Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: [commit#2+7.3] Re: [patch 1/2] physname reg.: linespec minsym fallback
Date: Mon, 04 Jul 2011 16:22:00 -0000	[thread overview]
Message-ID: <20110704142132.GA7866@host1.jankratochvil.net> (raw)
In-Reply-To: <201107041313.p64DDvoS029301@d06av02.portsmouth.uk.ibm.com>

On Mon, 04 Jul 2011 15:13:57 +0200, Ulrich Weigand wrote:
> On some machines (RHEL 5.6 with GCC 4.1.2 system compiler) I'm now seeing:
> 
> cc1: warnings being treated as errors
> /home/kwerner/dailybuild/spu-tc-2011-07-04/gdb-head/src/gdb/linespec.c: In function 'decode_line_1':
> /home/kwerner/dailybuild/spu-tc-2011-07-04/gdb-head/src/gdb/linespec.c:928: warning: 'values.nelts' may be used uninitialized in this function
> /home/kwerner/dailybuild/spu-tc-2011-07-04/gdb-head/src/gdb/linespec.c:928: warning: 'values.sals' may be used uninitialized in this function
> 
> Should there be an initializer somewhere?

This false GCC warning I have seen when TRY_CATCH is in use like in this case.

Curiously I failed to reproduce this warning on gcc-4.1.2-50.el5.x86_64.

Anyway checked in HEAD (below) and in 7.3:
	http://sourceware.org/ml/gdb-cvs/2011-07/msg00055.html


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2011-07/msg00054.html

--- src/gdb/ChangeLog	2011/07/01 20:27:58	1.13154
+++ src/gdb/ChangeLog	2011/07/04 14:16:13	1.13155
@@ -1,3 +1,8 @@
+2011-07-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Fix false GCC warning.
+	* linespec.c (decode_line_1): Initialize values.
+
 2011-07-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* linespec.c (find_method): Accept the function type automatically only
--- src/gdb/linespec.c	2011/07/01 20:27:58	1.125
+++ src/gdb/linespec.c	2011/07/04 14:16:14	1.126
@@ -932,6 +932,9 @@
 	  if (is_quote_enclosed)
 	    ++saved_arg;
 
+	  /* Initialize it just to avoid a GCC false warning.  */
+	  memset (&values, 0, sizeof (values));
+
 	  TRY_CATCH (ex, RETURN_MASK_ERROR)
 	    {
 	      values = decode_compound (argptr, funfirstline, canonical,


  reply	other threads:[~2011-07-04 14:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 20:27 Jan Kratochvil
2011-06-07 20:56 ` Tom Tromey
2011-06-08 15:04   ` Jan Kratochvil
2011-07-01 20:21 ` [commit] " Jan Kratochvil
2011-07-04 14:08   ` Ulrich Weigand
2011-07-04 16:22     ` Jan Kratochvil [this message]
2011-07-04 16:35       ` [commit#2+7.3] " Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110704142132.GA7866@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox