bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: enum instead of #define for tokens


From: Miles Bader
Subject: Re: RFC: enum instead of #define for tokens
Date: 02 Apr 2002 23:45:03 +0900

Akim Demaille <address@hidden> writes:
> Except for extremely bizarre scenarios which I'm able to imagine, but
> fail to see the real interest, I see no difference between #define and
> enums.  One such scenario would be for instance to have parts of the
> scanner compiled only when #ifdef SOME_TOKEN.  Are there people using
> such idioms?

You could do both, e.g:

   enum {
     ...
     FOO,
   #define FOO FOO
     ...
   };

Then you get the advantages of a enum, but can still use #ifdef.
[I think glibc does this in some of its header files.]

-Miles

-- 
Come now, if we were really planning to harm you, would we be waiting here, 
 beside the path, in the very darkest part of the forest?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]