Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!uwmacc!uwvax!oddjob!gargoyle!ihnp4!homxb!mtuxo!rolls!doug!tim
From: tim@doug.UUCP (Tim J Ihde)
Newsgroups: comp.lang.c
Subject: Re: Making re-#includes harmless--a simple solution?
Message-ID: <389@doug.UUCP>
Date: 14 Dec 87 14:46:17 GMT
References: <2000@bloom-beacon.MIT.EDU> <385@doug.UUCP> <6809@brl-smoke.ARPA>
Organization: AT&T ISL - Somerset, NJ
Lines: 43
Summary: options, options . . .

In article <6809@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes:
> In article <385@doug.UUCP> tim@doug.UUCP (Tim J Ihde) writes:
> -It simply
> -remembers each include file that it has read and will ignore it if the same
> -file shows up again.  This is definatly the way to go.
> 
> It definitely is NOT the way to go, and they're going to have to fix it
> before they can be ANSI conformant.

After reading some of the other responses to the initial article, I tend to
agree with you; although this facility is quite helpful in cases where you
are dealing with standard include files that do not have a line like
	#define	CTYPEH
or whatever.

Anyway, in the interum I obtained a copy of the manual page for this version
of cpp.  It lists a #pragma statement as follows:

	#pragma multiple
		Allows the current file to be included more than
		once.  The default action nomultiple causes each
		#include file to be included only once.

So in the true C style, it will allow people who know what they are doing
(or think they do) to go ahead and do it.  I assume that the reason they did
not make the standard functionality (ie multiple includes) the default was
because this would not have helped in cases such as with .  I think
I would have preferred for them to fix these include files instead of breaking
with the standard.

I also noticed a -I- option to the preprocessor, indicating that -I
listed directories appearing BEFORE the -I- in the command line are searched
only for "" included files, whereas and -I directories listed AFTER the
-I- are searched for either "" or <> included files.  Nmake generates command
lines using this format.  This might get around the problem of include
files with the same names if used carefully, but again this is non-standard.

		tim
-- 
Tim J. Ihde					ihnp4!ctsmain!doug!tim
(201) 535-9897

Ok, we can all agree that this is my fault.