www.delorie.com/gnu/docs/gdb/gdbint_118.html   search  
 
Buy the book!


GDB Internals

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.4.10 Include Files

A `.c' file should include `defs.h' first.

A `.c' file should directly include the .h file of every declaration and/or definition it directly refers to. It cannot rely on indirect inclusion.

A `.h' file should directly include the .h file of every declaration and/or definition it directly refers to. It cannot rely on indirect inclusion. Exception: The file `defs.h' does not need to be directly included.

An external declaration should only appear in one include file.

An external declaration should never appear in a .c file. Exception: a declaration for the _initialize function that pacifies `-Wmissing-declaration'.

A typedef definition should only appear in one include file.

An opaque struct declaration can appear in multiple `.h' files. Where possible, a `.h' file should use an opaque struct declaration instead of an include.

All `.h' files should be wrapped in:

 
#ifndef INCLUDE_FILE_NAME_H
#define INCLUDE_FILE_NAME_H
header body
#endif


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003