Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Steve Ellcey " <sellcey@imgtec.com>
To: <gdb-patches@sourceware.org>
Subject: [Patch] Fix GDB build when using GCC 4.1.2
Date: Tue, 01 Dec 2015 17:38:00 -0000	[thread overview]
Message-ID: <0adf15e3-d761-4de7-9ac7-ba3e3f283942@BAMAIL02.ba.imgtec.org> (raw)

A recent gdb change has broken my ability to build gdb with GCC 4.1.2. It
dies with:

/scratch/sellcey/repos/gdb/src/gdb/gdb/remote.c: In function 'remote_newthread_step':
/scratch/sellcey/repos/gdb/src/gdb/gdb/remote.c:2844: warning: 'item.name' is used uninitialized in this function
make[1]: *** [remote.o] Error 1


I am not seeing this error with newer GCC versions that I build with so it
may be a GCC bug but I would like to change gdb so I can still build with
GCC 4.1.2.  The fix is to simply initialize item.name in the locations where
item.extra is already being initialized.  This allows me to build gdb.

OK to checkin?

Steve Ellcey
sellcey@imgtec.com




2015-12-01  Steve Ellcey  <sellcey@imgtec.com>

	* remote.c (remote_newthread_step): Initialize item.name.
	(remote_get_threads_with_qthreadinfo): Ditto.


diff --git a/gdb/remote.c b/gdb/remote.c
index 90be8b6..753241a 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -2904,6 +2904,7 @@ remote_newthread_step (threadref *ref, void *data)
   item.ptid = ptid_build (pid, threadref_to_int (ref), 0);
   item.core = -1;
   item.extra = NULL;
+  item.name = NULL;
 
   VEC_safe_push (thread_item_t, context->items, &item);
 
@@ -3069,6 +3070,7 @@ remote_get_threads_with_qthreadinfo (struct target_ops *ops,
 		  item.ptid = read_ptid (bufp, &bufp);
 		  item.core = -1;
 		  item.extra = NULL;
+		  item.name = NULL;
 
 		  VEC_safe_push (thread_item_t, context->items, &item);
 		}


             reply	other threads:[~2015-12-01 17:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 17:38 Steve Ellcey  [this message]
2015-12-02  8:47 ` Yao Qi
2015-12-02 16:35   ` Steve Ellcey

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=0adf15e3-d761-4de7-9ac7-ba3e3f283942@BAMAIL02.ba.imgtec.org \
    --to=sellcey@imgtec.com \
    --cc=gdb-patches@sourceware.org \
    /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