9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Paul Lalonde <plalonde@telus.net>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] Include guards and multiple includes
Date: Fri, 20 Oct 2006 13:37:59 -0700	[thread overview]
Message-ID: <CB60E5CD-5335-41F1-949C-7E4F74ACD84A@telus.net> (raw)
In-Reply-To: <ee9e417a0610201318o469eeec9lacd7c7ed2924fcc1@mail.gmail.com>

-----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-----


  reply	other threads:[~2006-10-20 20:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-20 18:45 Paul Lalonde
2006-10-20 19:27 ` Joel Salomon
2006-10-20 20:18   ` Russ Cox
2006-10-20 20:37     ` Paul Lalonde [this message]
2006-10-22 16:37       ` Joel Salomon
2006-10-23 12:29         ` Charles Forsyth
2006-10-20 23:15 ` geoff
2006-10-20 23:39   ` Bruce Ellis
2006-10-24 14:32   ` AtomicKobold Design
2006-10-23 12:39 ` Rogelio Serrano
2006-10-23 12:41   ` erik quanstrom
2006-10-23 12:52     ` Rogelio Serrano
2006-10-23 13:26       ` erik quanstrom
2006-10-23 15:30         ` Joel Salomon
2006-10-23 18:43         ` Charles Forsyth
2006-10-23 19:12           ` Joel Salomon
2006-10-23 20:23             ` geoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CB60E5CD-5335-41F1-949C-7E4F74ACD84A@telus.net \
    --to=plalonde@telus.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).