C compiler ignors CTRL L

Henry Spencer henry at utzoo.UUCP
Sat Oct 6 02:01:33 AEST 1984


> Our C compiler (4.1 BSD) will ignor CTRL L's (form feeds). This is nice
> because it allows one to ask for a new page at the begining of subroutines.
> It is also not documented, probably non-standard, and probably should be an
> error. How far back does this "feature" go? Is it in all, most, of just a
> few of the compilers out there. If it is universal, shouldn't it be
> documented?

ANSI C draft of 21 Aug 1984, section 2.0:

	"Space characters, horizontal tabs, new-lines, vertical tabs,
	form feeds, and comments ... -- collectively called *white
	space* -- are ignored except as they serve to separate tokens."

So this particular feature can be assumed to be legitimate in future
C compilers.  Unfortunately, K&R's list of white-space characters is
not as long, and does *not* include formfeed, so there are probably
a good many current compilers out there that won't like it.  On the
other hand, simply removing all the formfeeds in a file is easy with
any text editor worthy of the name, so it doesn't seem like a big
stumbling block to portability.  If you really want to be 100% portable
with current compilers, put /* */ around the formfeeds.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list