bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnubg] open-brace style suggestion


From: TAKAHASHI Kaoru
Subject: [Bug-gnubg] open-brace style suggestion
Date: Mon, 01 Sep 2003 12:33:59 +0900
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SUTEMI/1.14.5 (platonic love) FLIM/1.14.5 (Demachiyanagi) MULE XEmacs/21.4 (patch 13) (Rational FORTRAN) (i386-unknown-freebsd5.1)

Hi,

I have suggestion as to style of open-brace that starts the body
of a C function.

I'm using Emacs.  I frequently used M-x beginning-of-defun (C-M-a)
for jump to beginning of function, and M-x add-change-log-entry
for write ChangeLog.  These command good work in gnubg/export.c,
But doesn't work in some other gnubg source.  Because, Emacs look
for open-braces in column zero to find the beginnings of C
functions.

Would you give me permission that change open-brace in *.c to
export.c style?


Cite GNU coding standards for reference:

Formatting Your Source Code
===========================

It is important to put the open-brace that starts the body of a C
function in column zero, and avoid putting any other open-brace or
open-parenthesis or open-bracket in column zero.  Several tools look
for open-braces in column zero to find the beginnings of C functions.
These tools will not work on code not formatted that way.

It is also important for function definitions to start the name of the
function in column zero.  This helps people to search for function
definitions, and may also help certain tools recognize them.  Thus, the
proper format is this:

     static char *
     concat (s1, s2)        /* Name starts in column zero here */
          char *s1, *s2;
     {                     /* Open brace in column zero here */
       ...
     }

or, if you want to use ANSI C, format the definition like this:

     static char *
     concat (char *s1, char *s2)
     {
       ...
     }
----------------------------------------------------------------

-- 
TAKAHASHI Kaoru <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]