[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CC Mode 5.28 (C); struct braces are not indented in GNU style
From: |
Richard Stallman |
Subject: |
Re: CC Mode 5.28 (C); struct braces are not indented in GNU style |
Date: |
Thu, 30 Nov 2006 14:48:59 -0500 |
GNU coding standards say:
"It is important to put the open-brace that starts the body of a C
function in column one, and avoid putting any other open-brace or
open-parenthesis or open-bracket in column one"
But given a code snippet like:
struct foobar
{
int x;
};
indent-region reformats it as:
struct foobar
{
int x;
};
which is contrary to the second clause of this sentence.
The standards are too strict; sometimes it is useful for the struct
defintion to be treated as a defun.
I don't think the C indentation commands know how to distinguish
functions from structs. But perhaps they should not alter
the indentation of a top-level open-brace.
What do others think of that?