On 07/26/2012 04:28 PM, Timur Tabi wrote:
> Michael Ellerman wrote:
>> And the bible, K & R, includes an example of an enum which explicitly
>> specifies all its values. It goes on to say "enumeration variables offer
>> the chance of [type] checking and so are often better than #defines".
> 
> I don't want to beat a dead horse here, but if the driver doesn't do enum
> type checking, then it's hard to justify using an enum.

Enum symbols show up in a debugger, which is nice.  Why use the
preprocessor for something that can be just as well expressed in the
language itself?  The only real argument for #define in this case is
style, which in Linux does tend toward favoring #define.

-Scott


_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to