This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[Patch] Fix GDB build when using GCC 4.1.2
- From: "Steve Ellcey " <sellcey at imgtec dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Tue, 1 Dec 2015 09:38:01 -0800
- Subject: [Patch] Fix GDB build when using GCC 4.1.2
- Authentication-results: sourceware.org; auth=none
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);
}