From owner-freebsd-hackers Thu Oct 17 11:05:58 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA17494 for hackers-outgoing; Thu, 17 Oct 1996 11:05:58 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id LAA17485; Thu, 17 Oct 1996 11:05:56 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA06082; Thu, 17 Oct 1996 11:03:26 -0700 From: Terry Lambert Message-Id: <199610171803.LAA06082@phaeton.artisoft.com> Subject: Re: enum considered bad ? To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Thu, 17 Oct 1996 11:03:25 -0700 (MST) Cc: phk@freebsd.org, hackers@freebsd.org In-Reply-To: <199610170804.JAA05315@labinfo.iet.unipi.it> from "Luigi Rizzo" at Oct 17, 96 09:04:01 am X-Mailer: ELM [version 2.4 PL24] 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 ? > > isn't it more a compatibility issue with old compilers which do not > support it ? Old compilers support enum... unless you are talking about "really old compilers". Old compilers didn't dictate option base -- enum was only guaranteed to be monotonically increasing if no assigned value was used; I have seen implementations which started at 0 and other whichstarted at 1. The real problem is probably that is is not a defined sized type. Other than the fact that it is signed (K&R requires this for its sample code), the size is undefined. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.