[GRASS5] Code formatting style

Glynn Clements glynn.clements at virgin.net
Fri Oct 11 16:08:35 EDT 2002


Bernhard Reiter wrote:

> I agree that a common code style is important.
> 
> My point was that automatic reformatting has to be followed 
> by human inspection.

Why? indent understands enough of C not to change the semantics of the
code. Outside of string literals and preprocessor directives, all
whitespace is equal.

> If there is no human inspection I'd not
> recommend a massive automatic reformatting.
> 
> Thus when you actually do development you can do the reformatting.
> Also possible as preprocessing step for automatic clone detection.  :)
> 
> We could look into the GNU coding styles...

indent understands the GNU, K&R, and Berkely predefined styles;
these are documented in the indent manpage.

More generally, I do think that the reformatting should be done
"aggressively", i.e. wherever you have a choice of "--foo" or
"--no-foo", you should choose one of them.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list