* fix for compilation error with gcc 3.2.3 (warning treated as error; `funaddr' might be used uninitialized)
@ 2008-02-14 9:39 Yakov Lerner
2008-02-14 16:51 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Yakov Lerner @ 2008-02-14 9:39 UTC (permalink / raw)
To: gdb-patches
Fix for the warning (warning treated as error)
`funaddr' might be used uninitialized in this function'
under gcc 3.2.3. I am not sure this is the best way to fix the warning, anyway.
*** gdb/infcall.c.000 Thu Feb 14 12:04:51 2008
--- gdb/infcall.c Thu Feb 14 12:19:07 2008
***************
*** 222,242 ****
else
{
/* Handle function descriptors lacking debug info. */
! int found_descriptor = 0;
if (VALUE_LVAL (function) == lval_memory)
{
! CORE_ADDR nfunaddr;
! funaddr = value_as_address (value_addr (function));
! nfunaddr = funaddr;
! funaddr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
! funaddr,
¤t_target);
! if (funaddr != nfunaddr)
! found_descriptor = 1;
}
- if (!found_descriptor)
- /* Handle integer used as address of a function. */
- funaddr = (CORE_ADDR) value_as_long (function);
}
value_type = builtin_type_int;
--- 222,238 ----
else
{
/* Handle function descriptors lacking debug info. */
! funaddr = (CORE_ADDR) value_as_long (function);
if (VALUE_LVAL (function) == lval_memory)
{
! CORE_ADDR nfunaddr, afunaddr;
! nfunaddr = value_as_address (value_addr (function));
! afunaddr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
! nfunaddr,
¤t_target);
! if (afunaddr != nfunaddr)
! funaddr = afunaddr;
}
}
value_type = builtin_type_int;
gcc -c -g -O2 -I. -I.././gdb -I.././gdb/config
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H
-I.././gdb/../include/opcode -I.././gdb/../readline/.. -I../bfd
-I.././gdb/../bfd -I.././gdb/../include -DMI_OUT=1 -DTUI=1 -Wall
-Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral
-Wno-unused -Wno-switch -Wno-char-subscripts -Werror infcall.c
cc1: warnings being treated as errors
infcall.c: In function `find_function_addr':
infcall.c:190: warning: `funaddr' might be used uninitialized in this function
make[2]: *** [infcall.o] Error 1
value_type = builtin_type_int;
--- 222,239 ----
else
{
/* Handle function descriptors lacking debug info. */
! funaddr = (CORE_ADDR) value_as_long (function);
if (VALUE_LVAL (function) == lval_memory)
{
! CORE_ADDR nfunaddr, afunaddr;
! nfunaddr = value_as_address (value_addr (function));
! afunaddr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
! nfunaddr,
¤t_target);
! if (afunaddr != nfunaddr)
! /* Handle integer used as address of a function. */
! funaddr = afunaddr;
}
}
value_type = builtin_type_int;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: fix for compilation error with gcc 3.2.3 (warning treated as error; `funaddr' might be used uninitialized)
2008-02-14 9:39 fix for compilation error with gcc 3.2.3 (warning treated as error; `funaddr' might be used uninitialized) Yakov Lerner
@ 2008-02-14 16:51 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2008-02-14 16:51 UTC (permalink / raw)
To: Yakov Lerner; +Cc: gdb-patches
On Thu, Feb 14, 2008 at 11:39:03AM +0200, Yakov Lerner wrote:
> Fix for the warning (warning treated as error)
> `funaddr' might be used uninitialized in this function'
> under gcc 3.2.3. I am not sure this is the best way to fix the warning, anyway.
Maybe you should just use --disable-werror? This compiler is almost
five years old, so I don't like the idea of working around its bugs.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-14 16:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-14 9:39 fix for compilation error with gcc 3.2.3 (warning treated as error; `funaddr' might be used uninitialized) Yakov Lerner
2008-02-14 16:51 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox