From owner-freebsd-hackers Thu Oct 17 06:22:16 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id GAA29389 for hackers-outgoing; Thu, 17 Oct 1996 06:22:16 -0700 (PDT) Received: from dyson.iquest.net ([198.70.144.127]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id GAA29379; Thu, 17 Oct 1996 06:22:13 -0700 (PDT) Received: (from root@localhost) by dyson.iquest.net (8.7.5/8.6.9) id IAA04122; Thu, 17 Oct 1996 08:22:10 -0500 (EST) From: "John S. Dyson" Message-Id: <199610171322.IAA04122@dyson.iquest.net> Subject: Re: enum considered bad ? To: phk@freebsd.org Date: Thu, 17 Oct 1996 08:22:10 -0500 (EST) Cc: hackers@freebsd.org In-Reply-To: <2022.845535270@critter.tfs.com> from "Poul-Henning Kamp" at Oct 17, 96 08:54:30 am Reply-To: dyson@freebsd.org X-Mailer: ELM [version 2.4 PL24 ME8] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > > 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 ? > I think that it is mostly habit. In C++, enum's are nice due to extra typechecking. ANSI-C does not afford typechecking of enums. Unfortunately an enum is roughly the same as an int in ANSI-C and misuse of an enum is easy (about the same as a #define.) John