Re: symfile.h missing "#include "symtab.h" ?

Daniel Jacobowitz
2007-03-21T01:54:17Z

On Tue, Mar 20, 2007 at 05:46:20PM -0700, Joel Brobecker wrote:
> Hello,
>
> I noticed this today: If I include symfile.h without including
> symtab.h first, I get a compilation error because domain_enum
> is not defined.

Yes, I noticed this before but never got around to fixing it. Sorry.

> I was about to send a patch to add the missing include, but then
> noticed:
>
> /* This file requires that you first include "bfd.h". */
>
> Is this something we're intending to keep? Shouldn't we just
> add the "#include "bfd.h" in that file? If not, then should we
> treat "symtab.h" the same way?

bfd.h, as it happens, is special - because it's included by defs.h.
Other headers generally require that. I don't think there should be
exceptions for other header dependencies, though. So please fix it!

We try to use forward declarations instead of #include where
possible, but of course that doesn't work for an enum.

--
Daniel Jacobowitz
CodeSourcery