[RFA] dwarf2read.c: complain() -> complaint()

Jim Blandy jimb@redhat.com
Wed Dec 11 14:15:00 GMT 2002


ac131313@redhat.com (Andrew Cagney) writes:
> > It looks fine to me.
> > 
> > I was uncomfortable with the idea of having to create wrapper
> > functions at first --- the idea being that each occurrence of a
> > complaint string is its own independent complaint --- but it seems
> > like it'll do the right thing by default more often than making people
> > create complaint structures.  So I'll go with that.
> 
> I'm not sure what you mean.  The wrapper function was only suggested
> when an identical complaint is being reported from more than one place
> in the file.  See "complaints.h".

I've read complaints.h, and complaints.c.  I guess the behavior which
would make more sense to me is for complaints with identical message
texts to be treated as the same complaint, even if they're made from
distinct source locations.  That way, the wrapper functions would be
unnecessary: you could just complain with the same text in two places,
and the identity of the messages would be enough to associate them.

As far as comparing format string addresses goes: don't compilers have
permission to merge identical strings, when strings are placed in
read-only memory?  That is, if I write "foo" in two places, can't the
compiler make them both point to the same memory?

If this is so, then the behavior of the complaints stuff depends on
compiler behavior.  (Not that that's a very imporant problem.)



More information about the Gdb-patches mailing list