Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 12/4/83; site rlgvax.UUCP Path: utzoo!watmath!clyde!burl!mgnetp!ihnp4!houxm!houxz!vax135!floyd!cmcl2!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.sources,net.lang.c Subject: Re: file include follower - "cpp" does nicely Message-ID: <1991@rlgvax.UUCP> Date: Tue, 5-Jun-84 01:28:46 EDT Article-I.D.: rlgvax.1991 Posted: Tue Jun 5 01:28:46 1984 Date-Received: Wed, 6-Jun-84 06:29:16 EDT References: <926@decwrl.UUCP> <478@wjh12.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 46 > I did not see this article, but I think that its conclusion > is wrong. As a file include follower, "cpp" has the following > two bugs: > (1) It will be fooled by #line directives. True. This is not a problem with most C code, only with that generated by a program like YACC. The include file follower which was submitted to the net doesn't do anything special about this, but it could be modified to do so (i.e., if it's chomping on a file "foo.y", it should throw out all references to "foo.c"). > (2) It will look at #if, sometimes skipping some #include's which should > not be skipped. That's not a bug, that's a feature. Take the following: /* * nnse - Nifty, neato screen editor. * Author: Z. Beeblebrox. */ /* * Grab the definitions of the TTY modes for the version of UNIX * we're using. */ #ifdef USG #include#else #include #endif . . . If you're generating a Makefile for a USG system, you may not want to have "sgtty.h" listed as something the program depends on (although it does happen to exist on USG systems), because it won't actually pull it in. The same applies to V7 and BSD systems (more so, since "termio.h" doesn't exist there). As such, you want to have the #ifs processed - the Makefile will therefore be dependent on which system you're compiling it for. That's common, anyway; the program might drag in different libraries on different versions of UNIX, for example. Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy