Projects for beginners
Fergus Henderson
fjh@cs.mu.oz.au
Wed Jan 31 20:19:00 GMT 2001
On 01-Feb-2001, James Dennett <jdennett@acm.org> wrote:
> Richard's comments are, IMO, wrong. The reason is that we should
> be able to include any header "x.h" without having to know about
> which headers it needs; for any header "x.h" the following should
> be a legal translation unit:
>
> /* xtest.c -- Test that "x.h" is self-contained */
> #include "x.h"
> /* EOF */
I agree.
For the Mercury runtime library, we have a rule in the Makefile that
checks this automatically, by creating such files and compiling them.
This rule is invoked by our nightly test script.
It might be a good idea to do the same kind of thing for GCC.
Probably starting off with only a very small list of header files
for which the test is run, but it could be extended over time.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh > | -- the last words of T. S. Garp.
More information about the Gcc
mailing list