Re: Use enum to declare errno values

From: Pekka Enberg
Date: Fri Dec 02 2005 - 08:34:32 EST


2005/12/2, Pekka Enberg <penberg@xxxxxxxxxxxxxx>:
> > I don't follow your reasoning. The naming collision is a real problem
> > with macros. With enum and const, the compiler can do proper checking
> > with meaningful error messages. Please explain why you think #define
> > is better for Denis' example?

On Fri, 2005-12-02 at 20:56 +0800, Coywolf Qi Hunt wrote:
> That is a bad bad style. It should be `#define FOO 123' if you have to
> write it.

Fair enough. And when you have two colliding constants, macros are
superior, because...?

Pekka

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