tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

enumeration of bicycle sheds

On Thu, 18 Feb 2010, Terry Moore wrote:

> Looking at C99, trailing commas _are_ allowed in enum lists.

I know that, but C89 expressly forbade it and apparently C++ is similar.
I'm not claiming that its reasonable and incidentally, share/misc/style
says to not use the comma..

If you or anybody wants to argue for or against enum vs #define for lists
of internal state variables, please go ahead. If the type checking for
enum was strong enough that

  enum val { FOO, BAR };
  int v = FOO;


  enum val { FOO, BAR };
  enum val v = 3;

actually caused warnings then I would be more inclined to use it. In the
meantime, I generally prefer #define but am not greatly attached.


Home | Main Index | Thread Index | Old Index