From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13843 invoked by alias); 8 Nov 2010 16:54:34 -0000 Received: (qmail 13835 invoked by uid 22791); 8 Nov 2010 16:54:31 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Nov 2010 16:54:24 +0000 Received: (qmail 2814 invoked from network); 8 Nov 2010 16:54:22 -0000 Received: from unknown (HELO pedro-airis.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Nov 2010 16:54:22 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [doc RFA] Switch to GCC coding style [Re: [patch] initial OpenCL C language support] Date: Mon, 08 Nov 2010 16:54:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-16-generic; KDE/4.3.5; i686; ; ) Cc: Mark Kettenis , brobecker@adacore.com, jan.kratochvil@redhat.com, eliz@gnu.org, dje@google.com, ken@linux.vnet.ibm.com, tromey@redhat.com References: <201010221920.30046.ken@linux.vnet.ibm.com> <20101108161121.GA2933@adacore.com> <201011081638.oA8GciFV005540@glazunov.sibelius.xs4all.nl> In-Reply-To: <201011081638.oA8GciFV005540@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201011081654.16724.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00121.txt.bz2 Mark Kettenis wrote: > > I agree that 1 document would be better, even if we end up duplicating > > some information in GCS. It's just simpler for everyone. > > Not sure about that. Quite a few people are already familliar with > the GNU Coding standards. Having a document that describes just the > additional bits means there is less material to read through, and less > likely for people to miss the GDB-specific bits. > I'm quite behind on reading gdb-patches@, but I agree. Currently, the "C Coding Standards" section in gdbint.exp reads: > "@section @value{GDBN} C Coding Standards > @value{GDBN} follows the GNU coding standards, as described in > @file{etc/standards.texi}. This file is also available for anonymous > FTP from GNU archive sites. @value{GDBN} takes a strict interpretation > of the standard; in general, when the GNU standard recommends a practice > but does not require it, @value{GDBN} requires it. > @value{GDBN} follows an additional set of coding standards specific to > @value{GDBN}, as described in the following sections." .. So we're already describing that we're stricter than the GNU coding standards, and that we follow an _additional_ set of coding. It appears to me that we should just list the extra rules quoted above in the "Formatting" subsection; > @subsection Formatting > @cindex source code formatting > The standard GNU recommendations for formatting must be followed > strictly. > A function declaration should not have its name in column zero. A > function definition should have its name in column zero. by just saying that the recommendations must be followed strictly, and and a sentence saying something to the effect of "the following list of extra GDB specific rules apply" (the ones I quoted from GCC earlier): Code in GDB should use the following formatting conventions: Use... ...instead of !x ! x ~x ~ x -x (unary minus) - x (foo) x (cast) (foo)x *x (pointer dereference) * x This is all I was suggesting before. Really.