Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@ges.redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [rfa/doco] Revise "Include Files" in internals doco
Date: Tue, 30 Jul 2002 08:42:00 -0000	[thread overview]
Message-ID: <3D46B233.6090201@ges.redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

Hello,

This tries to clarify GDB's include file coding policy.  It now makes a 
direct reference to opaque structures.

The rules haven't actually changes.

ok?
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 2187 bytes --]

2002-07-30  Andrew Cagney  <ac131313@redhat.com>
 
 	* gdbint.texinfo (Coding): Revise section "Include Files".
 
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.95
diff -c -r1.95 gdbint.texinfo
*** doc/gdbint.texinfo	24 Jul 2002 23:51:36 -0000	1.95
--- doc/gdbint.texinfo	30 Jul 2002 15:30:45 -0000
***************
*** 5065,5083 ****
  
  @subsection Include Files
  
! All @file{.c} files 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.
  
! 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.
  
! @code{extern} declarations should never appear in @code{.c} files.
  
! All include files should be wrapped in:
  
  @smallexample
  #ifndef INCLUDE_FILE_NAME_H
--- 5065,5094 ----
  
  @subsection Include Files
  
! A @file{.c} file should include @file{defs.h} first.
  
! 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.
  
! 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.
  
! An external declaration should only appear in one include file.
  
! 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

             reply	other threads:[~2002-07-30 15:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-30  8:42 Andrew Cagney [this message]
2002-07-31  3:47 ` Eli Zaretskii
2002-08-01  9:50   ` Andrew Cagney

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=3D46B233.6090201@ges.redhat.com \
    --to=ac131313@ges.redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox