From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11815 invoked by alias); 30 Jul 2002 15:35:21 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11800 invoked from network); 30 Jul 2002 15:35:19 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 30 Jul 2002 15:35:19 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id B4F883F50 for ; Tue, 30 Jul 2002 11:35:15 -0400 (EDT) Message-ID: <3D46B233.6090201@ges.redhat.com> Date: Tue, 30 Jul 2002 08:42:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020708 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [rfa/doco] Revise "Include Files" in internals doco Content-Type: multipart/mixed; boundary="------------040908010607060702050001" X-SW-Source: 2002-07/txt/msg00586.txt.bz2 This is a multi-part message in MIME format. --------------040908010607060702050001 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 169 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 --------------040908010607060702050001 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 2187 2002-07-30 Andrew Cagney * 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 --------------040908010607060702050001--