* [Patch] Fix GDB build when using GCC 4.1.2
@ 2015-12-01 17:38 Steve Ellcey
2015-12-02 8:47 ` Yao Qi
0 siblings, 1 reply; 3+ messages in thread
From: Steve Ellcey @ 2015-12-01 17:38 UTC (permalink / raw)
To: gdb-patches
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);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-02 16:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01 17:38 [Patch] Fix GDB build when using GCC 4.1.2 Steve Ellcey
2015-12-02 8:47 ` Yao Qi
2015-12-02 16:35 ` Steve Ellcey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox