file include follower

Sam Kendall kendall at wjh12.UUCP
Thu May 31 00:40:06 AEST 1984


The posted "#include follower" has the following bugs:

(1) The path specified in #include should be interpreted relative to the
    directory in which the file containing the #include resides.  In the
    posted program, all paths are interpreted relative to the current
    directory.  This makes a difference for commands like
	cc dir/file.c
    where file.c includes files in its own directory, and for nested
    #includes.
(2) Include lines like
	#include "stdio.h"
    (with "" rather than <>) should scan /usr/include after the includer
    file's directory, but they do not (I think; I didn't test the program).
(3) It does not handle -I options.
(4) It should exit(0) but does not.
(5) Error messages are posted to stdout rather than stderr.  Since
    #includes inside #ifdefs may legitimately fail, the error message
    will mess up any automatic use of this program.

A program to do all these things right is considerably longer.  Probably
one was posted in the past, but if not, I can dig mine up.

	Sam Kendall	{allegra,ihnp4,ima,amd70}!wjh12!kendall
	Delft Consulting Corp.	    decvax!genrad!wjh12!kendall



More information about the Comp.unix mailing list