Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Oct 1996 00:48:09 -0700
From:      Jason Thorpe <thorpej@nas.nasa.gov>
To:        phk@freebsd.org
Cc:        hackers@freebsd.org
Subject:   Re: enum considered bad ? 
Message-ID:  <199610170748.AAA28017@lestat.nas.nasa.gov>

next in thread | raw e-mail | index | archive | help
On Thu, 17 Oct 1996 08:54:30 +0200 
 Poul-Henning Kamp <phk@critter.tfs.com> wrote:

 > I've noticed that "enum" is hardly ever used in C programs, is this
 > because people consider it a bad idea or because they havn't really
 > got the swing of it ?

Actually, I happen to like it... I typically do stuff like:

typedef enum {
	VAL1, VAL2, VAL3, VAL4,
} foo_t;

foo_t	foo __P((int));

...or whatever...

The point is, I don't care want the return values are, so long as they're
unique.  In cases where I care about the value, or, more specifically,
the _size_ of the type, I use #define'd constants and more explicit types.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610170748.AAA28017>