lkml.org 
[lkml]   [2008]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: including .c files ?
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


\
 
 \ /
  Last update: 2008-08-08 21:15    [W:0.111 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site