This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: new switch that warns about missing includes


On 08-Aug-2001, Florian Schintke <schintke@zib.de> wrote:
> I am thinking of a switch for the gcc that warns you about missing
> includes of standard header files to get higher reliablity of your
> code.
...
> I don't know exectly how to implement this. Maybe you are
> interested to think about it.

I've been using the following Makefile recipe, which will catch some
but not all cases of header files which are not properly self-contained.

	HDRS = foo.h bar.h baz.h

	check: $(HDRS:%.h=%.check.o)

	%.check.c : %.h
		echo "#include \"$*.h\"" > $@

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]