Re: share/private/slave a subtree - define vs enum

From: Bryan Henderson
Date: Fri Jul 08 2005 - 12:18:22 EST


>If it's really enumerated data types, that's fine, but this example was
>about bitfield masks.

Ah. In that case, enum is a pretty tortured way to declare it, though it
does have the practical advantages over define that have been mentioned
because the syntax is more rigorous.

The proper way to do bitfield masks is usually C bit field declarations,
but I understand that tradition works even more strongly against using
those than against using enum to declare enumerated types.

>there is _nothing_ wrong with using defines for constants.

I disagree with that; I find practical and, more importantly,
philosophical reasons not to use defines for constants. I'm sure you've
heard the arguments; I just didn't want to let that statement go
uncontested.

-
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/