|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] recent major -unstable changes cause ia64 build to be br
On May 10, 2005, at 6:05 PM, Magenheimer, Dan (HP Labs Fort Collins)
wrote:
it. Here I will repeat my point about relying on implicit includes...
:)
Though I agree in principle with not using implicit includes,
it doesn't really work in reality.
Sorry, I strongly disagree. In this case, if every user of
alloc_xenheap_page() had included xen/mm.h, you would not have had any
problem.
For example, many
header files declare structs that use typedefs for elements
of the struct, which creates a direct dependency on a header
file. The only way to avoid including the header file directly
in the "parent" header file is by "instructing" all the users
of the "parent" header to first include the subsidiary ones.
The C language doesn't deal with this very well, resulting
in very obscure error messages if something is missing.
And since typedefs cannot be duplicately declared even if
identical (a bug in C I think), there's a catch-22.
If a.h uses something defined in b.h, a.h must include b.h. It is a
dependency. It's that simple.
I'm not saying recursive includes don't happen; they do. But once
you've got that working and you explicitly include your dependencies,
you won't see problems like this mm.h one, where changing one header
file causes 10 loosely related files to break. Coincidentally, it also
greatly simplifies writing a new set of header files for a new
architecture. ;)
I suspect the source of many of your problems is due to the strange
combination of two unrelated code bases, which makes your headers even
more brittle than Xen/x86...
--
Hollis Blanchard
IBM Linux Technology Center
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|