Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!zehntel!hplabs!hpda!fortune!wdl1!jbn From: jbn@wdl1.UUCP (John B. Nagle) Newsgroups: net.lang.c Subject: A Modest Extension to the C Preprocessor Message-ID: <377@wdl1.UUCP> Date: Wed, 1-Aug-84 15:48:02 EDT Article-I.D.: wdl1.377 Posted: Wed Aug 1 15:48:02 1984 Date-Received: Sat, 4-Aug-84 00:22:03 EDT Lines: 30 I propose that a new preprocessor directive be defined as follows: #use FILENAME to be interpreted identically to ``#include'', except that if FILENAME has already been included (either via #include or #use) during this compilation, #use does nothing. The intent here is to resolve the problem of dependency in header files. If all header files (``*.h'') by convention contain #use statements for all the header files they need, then C program text files (``*.c'') need only include the files the C program itself needs, and need not worry about internal dependencies in header file libraries. So this does for header files what linkers do for object files. It might seem tempting to change the semantics of #include to work this way, but this would introduce an incompatibility; some programs may be using #include to include things of which they want multiple copies. Portability would be increased by this enhancement, since at present the dependency structure of header files is not standardized, even between versions of UNIX (anyone doubting this should port something from V7 to system 5), and with this enhancement, the internal structure of the header files disappears from the user's programs. Comments? John Nagle Ford Aerospace and Communications Corp.