include file of includes 
Author Message
 include file of includes

Hello All,

I thought I would finally ask a question that his plagued me for a
while.

Generally I tried to just include the necessary .h required for that
source file.  For some reason this seems to be the clean way.

Right now I am in a situation where it would be really to have
myapplicationname.h as an include file that includes ALL necessary .h
files that may be used in the application.  Is this considered taboo?
Or OK in small applications?

Thanks



Sun, 28 Aug 2005 22:51:12 GMT  
 include file of includes

Quote:

> I thought I would finally ask a question that his plagued me for a
> while.

> Generally I tried to just include the necessary .h required for that
> source file.  For some reason this seems to be the clean way.

> Right now I am in a situation where it would be really to have
> myapplicationname.h as an include file that includes ALL necessary .h
> files that may be used in the application.  Is this considered taboo?
> Or OK in small applications?

This is discussed in the comp.lang.c FAQ:

http://www.eskimo.com/~scs/C-faq/top.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/



Sun, 28 Aug 2005 23:06:09 GMT  
 include file of includes

Quote:

> Hello All,

> I thought I would finally ask a question that his plagued me for a
> while.

> Generally I tried to just include the necessary .h required for that
> source file.  For some reason this seems to be the clean way.

> Right now I am in a situation where it would be really to have
> myapplicationname.h as an include file that includes ALL necessary .h
> files that may be used in the application.  Is this considered taboo?
> Or OK in small applications?

    Opinions will differ on this.  Mine is that the "kitchen
sink" header file is a Bad Idea: it seems like a useful
shorthand when first invented, but inevitably develops into
a catch-all that creates new problems.  Been there, done
that, rued the consequences.

    However, I don't subscribe to the purist notion that
headers should never #include other headers.  For example,
if I'm writing a header declaring some functions that take
`FILE*' arguments, I will #include <stdio.h> in that header
rather than require the user to do so on his own.  The idea
here is that my header should stand on its own: if it needs
`FILE*' or `jmp_buf' or some such, it takes responsibility
for seeing that these types are properly declared.

    Opinions differ, though.  Both reasonable and unreasonable
people will disagree with mine.

--



Mon, 29 Aug 2005 00:01:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Why won't a include file get included some times and not other

2. Missing includes in /usr/include/linux/*.h and /usr/include/asm.h

3. source for included included files

4. How to include CRecordset without including MFC?

5. #including your #include....

6. fatal error C1083: Cannot open include file: 'excpt.h': No such file or directory

7. C Header files including header files, mutually referencing typedefs

8. Fortran include file to C header file conversion

9. Questions about include files, and make file error

10. Newbie - Compile error (Cannot open include file: 'xmldom.idl': No such file or directory)

11. Including an IDL file in an IDL file

12. How to include header files and other files??

 

 
Powered by phpBB® Forum Software