This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] trying to kill a warning in hpread.c (from call to complaint)



      complaint (&symfile_complaints, "bad string table offset in symbol %d", \
                 (char *) symnum); \
      *NAMEP = ""; \
    } \
  else \
    *NAMEP = (SYM)->dsfile.name + VT (OBJFILE)

I think that the warning comes from the call to complaint where the
format string contains "%d", but the next parameter is casted to a
"char *".

Is the cast to "char *" necessary? Can/Should I remove it?

Looks like a typo in Kevin's complaint patch.
Nope. The original code was broken:

complain (&string_table_offset_complaint, (char *) symnum);

(complaint -> complaints finds another victim / bug).

> I'd say yes; and in the calls to lbrac_unmatched_complaint, too.

Joel, if you encounter a macro, first thing to do is always to convert it to a function :-)

Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]