This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] gnu-ifunc code false gcc warning [Re: [patch] fix build on FreeBSD with gcc-4.2]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Andreas Tobler <andreast at fgznet dot ch>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 29 Mar 2011 18:24:03 +0200
- Subject: [commit] gnu-ifunc code false gcc warning [Re: [patch] fix build on FreeBSD with gcc-4.2]
- References: <4D91EEB8.10104@fgznet.ch>
Hi Andreas,
On Tue, 29 Mar 2011 16:37:44 +0200, Andreas Tobler wrote:
> the below patch fixes the build on amd64 FreeBSD. I do not know if
> it is a gcc issue, I guess so.
> --- infcall.c 28 Mar 2011 20:26:24 -0000 1.143
> +++ infcall.c 29 Mar 2011 14:35:44 -0000
> - CORE_ADDR funaddr;
> + CORE_ADDR funaddr = 0;
[cut]
I have checked the function the variable really is not used initialized and it
must be only a gcc bug there.
This was a compilation regression.
Checked in as obvious.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2011-03/msg00320.html
--- src/gdb/ChangeLog 2011/03/29 15:49:50 1.12871
+++ src/gdb/ChangeLog 2011/03/29 16:21:16 1.12872
@@ -1,3 +1,8 @@
+2011-03-29 Andreas Tobler <andreast-list@fgznet.ch>
+
+ Fix false GCC warning.
+ * infcall.c (find_function_addr): Initialize funaddr.
+
2011-03-29 Pierre Muller <muller@ics.u-strasbg.fr>
Fix mingw compilation with --enable-targets=all.
--- src/gdb/infcall.c 2011/03/28 20:26:24 1.143
+++ src/gdb/infcall.c 2011/03/29 16:21:24 1.144
@@ -252,7 +252,8 @@
struct type *ftype = check_typedef (value_type (function));
struct gdbarch *gdbarch = get_type_arch (ftype);
struct type *value_type = NULL;
- CORE_ADDR funaddr;
+ /* Initialize it just to avoid a GCC false warning. */
+ CORE_ADDR funaddr = 0;
/* If it's a member function, just look at the function
part of it. */