This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [doc RFA] Switch to GCC coding style [Re: [patch] initial OpenCL C language support]


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]