Re: Comma at end of enum lists
From: Al Viro
Date: Sat Mar 29 2008 - 13:52:46 EST
On Sat, Mar 29, 2008 at 10:28:26AM -0700, H. Peter Anvin wrote:
> Yes, it is.
>
> I personally prefer it this way (strongly) for exactly the same reason C
> requires a semicolon at the end of each statement, as opposed to Pascal
> which doesn't require a semicolon immediately before an "end".
enum foo {
Foo,
Bar,
Baz,
Max_foo = Baz
};
when you know there won't any additions past the last line (for that matter,
ending it with
Baz,
Sentry_foo,
Max_foo = Sentry_foo - 1
}; is also an option, in which case the end of enum will never be touched
at all).
enum {Some_constant = ...};
when you do not want to mix it with other constants and use a separate
enum for each natural group.
Sometimes it makes sense, sometimes it doesn't. It is an expressive
element, not something to be cast in stone by Documentation/CodingStyle.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/