[COMMIT] Fix some compiler warnings
Mark Kettenis
mark.kettenis@xs4all.nl
Sun Mar 20 20:35:00 GMT 2005
GCC 2.95.3 complains about variables being clobbered by setjmp in our
TRY_CATCH construct. Apparently it is not clever enough to realize
that these variables are only used if no jump took place. The
attached patch makes it shut up.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* dwarf2loc.c (dwarf_expr_tls_address): Mark addr as volatile.
* varobj.c (my_value_equal): Mark val2 as volatile.
Index: dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.24
diff -u -p -r1.24 dwarf2loc.c
--- dwarf2loc.c 19 Mar 2005 19:44:10 -0000 1.24
+++ dwarf2loc.c 20 Mar 2005 20:26:19 -0000
@@ -186,7 +186,7 @@ static CORE_ADDR
dwarf_expr_tls_address (void *baton, CORE_ADDR offset)
{
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
- CORE_ADDR addr = 0;
+ volatile CORE_ADDR addr = 0;
if (target_get_thread_local_address_p ())
{
Index: varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/varobj.c,v
retrieving revision 1.52
diff -u -p -r1.52 varobj.c
--- varobj.c 28 Feb 2005 17:00:49 -0000 1.52
+++ varobj.c 20 Mar 2005 20:26:20 -0000
@@ -1450,7 +1450,7 @@ variable_default_display (struct varobj
can't be established, *ERROR2 is set to non-zero. */
static int
-my_value_equal (struct value *val1, struct value *val2, int *error2)
+my_value_equal (struct value *val1, struct value *volatile val2, int *error2)
{
volatile struct exception except;
More information about the Gdb-patches
mailing list