From: Jim Kingdon Date: Sat, 18 Sep 1993 21:11:25 +0000 (+0000) Subject: * mipsread.c (parse_type): Don't complain() if we guessed struct X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1fdbc4d17b058ba8b425188fbe77f68987bf2951;p=binutils-gdb.git * mipsread.c (parse_type): Don't complain() if we guessed struct and it was a union, or vice versa. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2a174a59eb7..6aecd17f2a5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ Sat Sep 18 10:13:18 1993 Jim Kingdon (kingdon@poseidon.cygnus.com) + * mipsread.c (parse_type): Don't complain() if we guessed struct + and it was a union, or vice versa. + * defs.h (make_cleanup): Change PTR to void * when inside PARAMS. Some of the following is in #ifdef CALL_DUMMY_BREAKPOINT_OFFSET. diff --git a/gdb/mipsread.c b/gdb/mipsread.c index e380150b8ff..1c70aa7e142 100644 --- a/gdb/mipsread.c +++ b/gdb/mipsread.c @@ -1466,12 +1466,22 @@ parse_type (fd, ax, bs, bigend, sym_name) { /* Usually, TYPE_CODE(tp) is already type_code. The main - exception is if we guessed wrong re struct/union/enum. */ - if (TYPE_CODE (tp) != type_code) + exception is if we guessed wrong re struct/union/enum. + But for struct vs. union a wrong guess is harmless, so + don't complain(). */ + if ((TYPE_CODE (tp) == TYPE_CODE_ENUM + && type_code != TYPE_CODE_ENUM) + || (TYPE_CODE (tp) != TYPE_CODE_ENUM + && type_code == TYPE_CODE_ENUM)) { complain (&bad_tag_guess_complaint, sym_name); + } + + if (TYPE_CODE (tp) != type_code) + { TYPE_CODE (tp) = type_code; } + /* Do not set the tag name if it is a compiler generated tag name (.Fxx or .xxfake or empty) for unnamed struct/union/enums. */ if (name[0] == '.' || name[0] == '\0')