All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Rene Herman <rene.herman@keyaccess.nl>
Cc: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: including .c files ?
Date: Fri, 08 Aug 2008 12:13:14 -0700	[thread overview]
Message-ID: <489C9ACA.5060501@zytor.com> (raw)
In-Reply-To: <489C681B.1020805@keyaccess.nl>

Rene Herman wrote:
> 
> If you think about it -- in C, #include really at least conceptually 
> means "cut & paste this in here, please" meaning headers are not 
> anything special and .h and .c seperation is a mere convention.
> 
> As we all know, conventions exist _only_ to be violated...
> 

The real issue is that the convention -- .c versus .h -- recognize *two* 
kinds of files, but there really are *three* kinds of files:

- Files meant to be included that generate no code (.h)
- Files meant to be included that generate code (???)
- Files not meant to be included (.c)

Some projects -- including the Linux kernel -- have adopted the 
convention that the middle type should be .c, others .h, others probably 
other variants.  You typically want them treated as .h files for 
purposes of generating dependencies, but like .c files for purposes of, 
say, header file include guard checking.

	-hpa

      reply	other threads:[~2008-08-08 19:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08 11:25 including .c files ? Frans Meulenbroeks
2008-08-08 14:30 ` Krzysztof Halasa
2008-08-08 15:05   ` Chris Friesen
2008-08-08 15:46     ` Krzysztof Halasa
2008-08-08 15:36 ` Rene Herman
2008-08-08 19:13   ` H. Peter Anvin [this message]

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=489C9ACA.5060501@zytor.com \
    --to=hpa@zytor.com \
    --cc=fransmeulenbroeks@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rene.herman@keyaccess.nl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.