Xref: utzoo comp.lang.c:23259 comp.lang.c++:5207 gnu.g++:471 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hplabs!hplabsz!sartin From: sartin@hplabsz.HPL.HP.COM (Rob Sartin) Newsgroups: comp.lang.c,comp.lang.c++,gnu.g++ Subject: Re: A solution to the multiple inclusion problem Keywords: #include c Message-ID: <4207@hplabsz.HPL.HP.COM> Date: 24 Oct 89 19:35:57 GMT References: <14240@well.UUCP> <1989Oct23.191634.6345@cs.rochester.edu> <1659@atanasoff.cs.iastate.edu> Reply-To: sartin@hplabsz.UUCP (Rob Sartin) Distribution: comp Organization: Hewlett-Packard, Software Technology Lab Lines: 35 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) That introduces some potential oddities for which doesn't try to prevent from being included twice. My C++ 2.0 assert.h includes a comment that says: /* This header file intentionally has no wrapper, since the user * may want to re-include it to turn off/on assertions for only * a portion of the source file. */ > but, does anyone do this thing in the *same* file?? =begin foo.c #define NDEBUG #include int tested_function() { ... } #undef NDEBUG #include int untested_function() { } =end foo.c Rob Sartin internet: sartin@hplabs.hp.com Software Technology Lab uucp : hplabs!sartin Hewlett-Packard voice : (415) 857-7592