Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ulysses!fox From: fox@allegra.att.com (David Fox) Newsgroups: comp.lang.c Subject: Re: A solution to the multiple inclusion problem Message-ID: Date: 27 Oct 89 01:51:45 GMT References: <14240@well.UUCP> <11396@smoke.BRL.MIL> <288@charyb.COM> Sender: netnews@ulysses.homer.nj.att.com Followup-To: comp.lang.c Organization: AT&T Bell Laboratories Lines: 30 In-reply-to: dave@charyb.COM's message of 26 Oct 89 07:03:25 GMT A problem with the idea of having the compiler recognize the #ifndef FOO #define FOO ... #endif arrangement (I wouldn't call it a construct) is what if the including file explicitly #undefs FOO? Then the semantics are not preserved. A somewhat unlikely occurence, I'll admit. A problem I've run into with the construct itself (with a standard preprocessor) is that I often create a new header file by copying an old one. You can guess what happens: for some strange reason the compiler doesn't recognize the new type name. My real objection is that I don't like having to type three lines in order to say one thing. I don't go to great lengths to reuse code rather than rewrite it just to sprinkle my code liberally with obscure three line constructs that just mean "not again!" David Fox -- +-----------------------------------------+ David Fox |End tax incentives for leveraged buyouts!| fox@allegra.att.com +-----------------------------------------+ (presumably)