RFA: abstract C++ ABI dependencies

Daniel Berlin dan@cgsoftware.com
Tue Apr 24 23:35:00 GMT 2001


Eli Zaretskii <eliz@is.elta.co.il> writes:

> On 24 Apr 2001, Jim Blandy wrote:
> 
> > > 	    * c-typeprint.c, c-valprint.c, dbxread.c, eval.c, gdbtypes.c,
> > > 	    jv-typeprint.c, linespec.c, symtab.c, typeprint.c, valops.c:
> > > 	    #include "cp-abi.h".
> > > 
> > > For c-valprint.c, eval.c, typeprint.c, and valops.c, it is unclear to
> > > me why you are including cp-abi.h.
> > 
> > Because they use functions which used to be declared elsewhere, but
> > are now declared in cp-abi.h.  I've clarified the ChangeLog entry.
> 
> Isn't it better to put such explanations in the files which include 
> cp-abi.h, rather than in a ChangeLog?
> 
> ChangeLog entries are not supposed to explain the reasons for the changes,
> just the changes themselves; see standards.texi.  Beyond the Word of The
> Law in standards.texi, I find it much easier to read comments right where
> I might ask myself ``why the heck did they include this header?'' than to 
> grep through lots of ChangeLog entries. 

Errr, i don't see any other comments on header includes.
It doesn't make sense to me, on so many levels.
Why would you list the reasons for including a given header? 

If you want to know what's in the header, and you can't tell from the
top of the header itself, or the filename of the header, well, then,
there's probably something else wrong.

If, for example, I have to tell you that it included symtab.h because
that's where  some of the C++ ABI related macros it uses are
located, and it doesn't seem  to be clear to the user of the header
file, then maybe they shouldn't  be in symtab.h. Maybe they should be
in, for example, cp-abi.h.

Especially when symtab.h might say at the top "Symbol table stuff".
You wouldn't really expect C++ ABI macros related to all kinds of
stuff, but strangely, not at all to symbol tables, to be in there,
would you?

If we have to document something like this in each file that includes
it, it means something was counter-intuitive. It means there should
have been comments before (or none, ever), and we should be able to
remove them now.

-- 
"I busted a mirror and got seven years bad luck, but my lawyer
thinks he can get me five.
"-Steven Wright



More information about the Gdb-patches mailing list