From mboxrd@z Thu Jan 1 00:00:00 1970 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: References: <219D85AA-959D-464C-90C2-0F132809F0B9@telus.net> <7871fcf50610201227s17987c4at9bafba8729f8a6b9@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Paul Lalonde Subject: Re: [9fans] Include guards and multiple includes Date: Fri, 20 Oct 2006 13:37:59 -0700 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Topicbox-Message-UUID: cf521788-ead1-11e9-9d60-3106f5b1d025 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ah well, there goes one argument for keeping the header soup clean. The best runner-up wrangling technique proposed is that any foo.c implementation of the interface in foo.h should have foo.h first to ensure that all of foo.h's include requirements are satisfied by foo.h itself. I just wish there were tools for enforcing these sorts of things :-( Thanks, Paul On 20-Oct-06, at 1:18 PM, Russ Cox wrote: > There was a time when there was an efficiency argument > to be made (don't have to read and parse the files over and over), > but gcc did an end run around it by recognizing files with > the traditional #ifndef #define #endif sequence and > then not even re-opening the file the next time it gets > included. > > Arguably gcc didn't even have to do this, though: the rest > of the compiler is so slow that parsing the headers multiple > times is hardly the performance bottleneck. > > Russ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) iD8DBQFFOTOnpJeHo/Fbu1wRAgL3AKCK8w/FW9CXIOO1zAtrAisbzJRsrACdHEAJ Pk+Uj196otCysy4+xmgJcPA= =TLlz -----END PGP SIGNATURE-----