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

From: Roman Zippel
Date: Fri Jul 08 2005 - 12:00:25 EST


Hi,

On Fri, 8 Jul 2005, Bryan Henderson wrote:

> I wasn't aware anyone preferred defines to enums for declaring enumerated
> data types.

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

> Isn't the only argument for defines, "that's what I'm used to."?

defines are not just used for constants and there is _nothing_ wrong with
using defines for constants.

> The macro language is one the most hated parts of the C language; it makes
> sense to try to avoid it as a general rule.

Nevertheless it's part of the language, it's used all over the kernel and
suddenly starting to mix different types of definitions, makes things
only worse. I prefer consistency here over any minor advantages enums
might have.

bye, Roman
-
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/