[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080329175227.GB9785@ZenIV.linux.org.uk>
Date: Sat, 29 Mar 2008 17:52:27 +0000
From: Al Viro <viro@...IV.linux.org.uk>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Jacek Luczak <difrost.kernel@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: Comma at end of enum lists
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists