| www.delorie.com/gnu/docs/gdb/gdbint_112.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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.
/* Declaration */
static void foo (void);
/* Definition */
void
foo (void)
{
}
|
Pragmatics: This simplifies scripting. Function definitions can be found using `^function-name'.
There must be a space between a function or macro name and the opening parenthesis of its argument list (except for macro definitions, as required by C). There must not be a space after an open paren/bracket or before a close paren/bracket.
While additional whitespace is generally helpful for reading, do not use
more than one blank line to separate blocks, and avoid adding whitespace
after the end of a program line (as of 1/99, some 600 lines had
whitespace after the semicolon). Excess whitespace causes difficulties
for diff and patch utilities.
Pointers are declared using the traditional K&R C style:
void *foo; |
and not:
void * foo; void* foo; |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |