This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/ob]
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 11 Dec 2001 10:18:05 -0800
- Subject: [patch/ob]
Just FYI,
I've checked the attached in as, er, obvious. It fixes a
-Wuninitialized warning.
Andrew
2001-12-11 Andrew Cagney <ac131313@redhat.com>
* values.c: Include "gdb_assert.h".
(value_fn_field): Rearange to avoid -Wuninitialized warning.
Index: values.c
===================================================================
RCS file: /cvs/src/src/gdb/values.c,v
retrieving revision 1.30
diff -p -r1.30 values.c
*** values.c 2001/12/10 23:05:00 1.30
--- values.c 2001/12/11 18:05:09
***************
*** 33,38 ****
--- 33,39 ----
#include "scm-lang.h"
#include "demangle.h"
#include "doublest.h"
+ #include "gdb_assert.h"
/* Prototypes for exported functions. */
*************** value_fn_field (value_ptr *arg1p, struct
*** 971,983 ****
struct minimal_symbol *msym;
sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL);
! if (!sym)
{
msym = lookup_minimal_symbol (physname, NULL, NULL);
}
-
- if (!sym && !msym)
- return NULL;
v = allocate_value (ftype);
if (sym)
--- 972,988 ----
struct minimal_symbol *msym;
sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL);
! if (sym != NULL)
{
+ msym = NULL;
+ }
+ else
+ {
+ gdb_assert (sym == NULL);
msym = lookup_minimal_symbol (physname, NULL, NULL);
+ if (msym == NULL)
+ return NULL;
}
v = allocate_value (ftype);
if (sym)