diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-08-01 16:49:25 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-08-01 16:49:25 +0000 |
commit | e2b28d048de97e7007086f4b50617060b6690d76 (patch) | |
tree | 95adb51176735ec2f1f81e6ca32d7f9994edbbd2 | |
parent | 08df23795b3c1ac9a1fdb57c9f1d0616fe1b2fba (diff) | |
download | gdb-e2b28d048de97e7007086f4b50617060b6690d76.zip gdb-e2b28d048de97e7007086f4b50617060b6690d76.tar.gz gdb-e2b28d048de97e7007086f4b50617060b6690d76.tar.bz2 |
2002-08-01 Andrew Cagney <ac131313@redhat.com>
* gdbint.texinfo (Coding): Revise section "Include Files".
-rw-r--r-- | gdb/doc/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/doc/gdbint.texinfo | 29 |
2 files changed, 24 insertions, 9 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 3cbd58c..a6e1afe 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2002-08-01 Andrew Cagney <ac131313@redhat.com> + + * gdbint.texinfo (Coding): Revise section "Include Files". + 2002-07-24 Andrew Cagney <cagney@redhat.com> * gdbint.texinfo: Obsolete references to m88k. diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index cd7a4eb..0336015 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -5065,19 +5065,30 @@ For other files @samp{-} is used as the separator. @subsection Include Files -All @file{.c} files should include @file{defs.h} first. +A @file{.c} file should include @file{defs.h} first. -All @file{.c} files should explicitly include the headers for any -declarations they refer to. They should not rely on files being -included indirectly. +A @file{.c} file should directly include the @code{.h} file of every +declaration and/or definition it directly refers to. It cannot rely on +indirect inclusion. -With the exception of the global definitions supplied by @file{defs.h}, -a header file should explicitly include the header declaring any -@code{typedefs} et.al.@: it refers to. +A @file{.h} file should directly include the @code{.h} file of every +declaration and/or definition it directly refers to. It cannot rely on +indirect inclusion. Exception: The file @file{defs.h} does not need to +be directly included. -@code{extern} declarations should never appear in @code{.c} files. +An external declaration should only appear in one include file. -All include files should be wrapped in: +An external declaration should never appear in a @code{.c} file. +Exception: a declaration for the @code{_initialize} function that +pacifies @option{-Wmissing-declaration}. + +A @code{typedef} definition should only appear in one include file. + +An opaque @code{struct} declaration can appear in multiple @file{.h} +files. Where possible, a @file{.h} file should use an opaque +@code{struct} declaration instead of an include. + +All @file{.h} files should be wrapped in: @smallexample #ifndef INCLUDE_FILE_NAME_H |