From owner-freebsd-hackers Thu Oct 17 00:59:45 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id AAA13381 for hackers-outgoing; Thu, 17 Oct 1996 00:59:45 -0700 (PDT) Received: from lestat.nas.nasa.gov (lestat.nas.nasa.gov [129.99.50.29]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id AAA13376; Thu, 17 Oct 1996 00:59:43 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lestat.nas.nasa.gov (8.7.5/8.6.12) with SMTP id AAA28017; Thu, 17 Oct 1996 00:48:09 -0700 (PDT) Message-Id: <199610170748.AAA28017@lestat.nas.nasa.gov> X-Authentication-Warning: lestat.nas.nasa.gov: Host localhost [127.0.0.1] didn't use HELO protocol To: phk@freebsd.org Cc: hackers@freebsd.org Subject: Re: enum considered bad ? Reply-To: Jason Thorpe From: Jason Thorpe Date: Thu, 17 Oct 1996 00:48:09 -0700 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Thu, 17 Oct 1996 08:54:30 +0200 Poul-Henning Kamp 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