Xref: utzoo comp.lang.c:23191 comp.lang.c++:5187 gnu.g++:466 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!bfmny0!tneff From: tneff@bfmny0.UU.NET (Tom Neff) Newsgroups: comp.lang.c,comp.lang.c++,gnu.g++ Subject: Re: A solution to the multiple inclusion problem Keywords: #include c Message-ID: <14790@bfmny0.UU.NET> Date: 24 Oct 89 05:29:32 GMT References: <14240@well.UUCP> <1989Oct23.191634.6345@cs.rochester.edu> <1659@atanasoff.cs.iastate.edu> Reply-To: tneff@bfmny0.UU.NET (Tom Neff) Followup-To: comp.lang.c Distribution: comp Organization: ^ Lines: 15 Summary: Expires: Sender: Followup-To: In article <1659@atanasoff.cs.iastate.edu> hascall@atanasoff.UUCP (John Hascall) writes: > Since the impending ANSI standard requires that including a file more > than once have exactly the same effect as including it once...why can't > a compiler just ignore #includes for files it has already #included??? > (at least for the "standard" includes) Including standard HEADER files should be idempotent. Back here in the real world there are plenty of uses for including a file multiple times with a desired substantial effect on each inclusion. Examples include program generated data tables, copyright strings, and machine dependent code sequences. Any compiler that unconditionally ignored an include file on the second mention would be horribly broken. -- "My God, Thiokol, when do you \\ Tom Neff want me to launch? Next April?" \\ tneff@bfmny0.UU.NET