Re: Use enum to declare errno values

From: Bill Davidsen
Date: Fri Dec 02 2005 - 11:03:56 EST


Coywolf Qi Hunt wrote:

This is a reason why enums are worse than #defines.

Unlike in other languages, C enum is not much useful in practices.

Actually they are highly useful if you know how to use them. They allow type checking, have auto increment, and are part of the language instead of a feature of the preprocessor.

Maybe the designer wanted C to be as fancy as other languages? C
shouldn't have had enum imho. Anyway we don't have any strong motives
to switch to enums.

The last sentence seems correct in spite of your misunderstanding of how and why enums are used and useful. Like a driver who mis-read a map wandering aimlessly and lost, you have come to the correct destination by accident.

--
Coywolf Qi Hunt
http://sosdg.org/~coywolf/

It would have been good to use enums in the first place, I can't see changing now because of the effort involved.

--
bill davidsen <davidsen@xxxxxxx>
CTO TMR Associates, Inc
Doing interesting things with small computers since 1979
-
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/