tech-kern archive

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

Re: enumeration of bicycle sheds



Sorry, misread original comment -- C89 appeared as C99. Old eyes can be as bad as old ears for intelligent discussion....

--Terry

tmm%mcci.com@localhost    tel: +1-607-277-1029    fax: +1-607-277-6844    
www.mcci.com


On 2/18/2010 8:18 AM, Iain Hibbert wrote:
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;

or

   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.

iain





Home | Main Index | Thread Index | Old Index