This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [doc RFA] Switch to GCC coding style [Re: [patch] initial OpenCL C language support]
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Mark Kettenis <mark dot kettenis at xs4all dot nl>, brobecker at adacore dot com, jan dot kratochvil at redhat dot com, eliz at gnu dot org, dje at google dot com, ken at linux dot vnet dot ibm dot com, tromey at redhat dot com
- Date: Mon, 8 Nov 2010 16:54:16 +0000
- Subject: Re: [doc RFA] Switch to GCC coding style [Re: [patch] initial OpenCL C language support]
- References: <201010221920.30046.ken@linux.vnet.ibm.com> <20101108161121.GA2933@adacore.com> <201011081638.oA8GciFV005540@glazunov.sibelius.xs4all.nl>
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.