Messages in this thread | | | From | Nikita Danilov <> | Date | Wed, 23 Nov 2005 18:55:31 +0300 | Subject | Re: Use enum to declare errno values |
| |
moreau francis writes:
[...]
> > I guess we won't use enumeration because it needs to many changes...Each > function that returns a errno value should have their prototype changed like > this: > > int foo(void) > { > int retval; > [...] > return retval; > } > > should be changed into > > enum errnoval foo(void) > { > enum errnoval retval; > [...] > return retval; > }
No it shouldn't. Following is a perfectly legal thing to do in C:
enum side { LEFT, RIGHT };
int foo(int x) { if (x & 0x1) return LEFT; else return RIGHT; }
This is not C++ fortunately.
Nikita. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |