[GRASS5] Code formatting style

Bernhard Reiter bernhard at intevation.de
Fri Oct 11 16:28:30 EDT 2002


On Fri, Oct 11, 2002 at 09:08:35PM +0100, Glynn Clements wrote:
> 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.

Some content is hidden in the structure of code and non-code.
Not a lot, though but it might be decisive.

> > 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.

Actually I'm beginning to agree with you that we should do as much
reformatting as we can before inserting files in the Grass 5.1 cvs.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20021011/c5a27d04/attachment.bin


More information about the grass-dev mailing list