lkml.org 
[lkml]   [2005]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Use enum to declare errno values
Date
On Wednesday 23 November 2005 15:24, moreau francis wrote:
> Hi,
>
> I'm just wondering why not declaring errno values using enumaration ? It is
> just more convenient when debuging the kernel.

Enums are really nice substitute for integer constants instead of #defines.
Enums obey scope rules, #defines do not.

However enums are not widely used because of
1. tradition and style
2. awkward syntax required: enum { ABC = 123 };

Maybe a macro could help

#define CONST(a, N) enaum { a = N }

CONST(ABC, 123);
CONST(DEF, 456);
--
vda
-
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/

\
 
 \ /
  Last update: 2005-11-23 15:35    [W:0.089 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site