From owner-freebsd-hackers Thu Oct 17 06:29:43 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id GAA29765 for hackers-outgoing; Thu, 17 Oct 1996 06:29:43 -0700 (PDT) Received: from lassie.eunet.fi (lassie.eunet.fi [192.26.119.7]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id GAA29752 for ; Thu, 17 Oct 1996 06:29:08 -0700 (PDT) Received: from marathon.tekla.fi by lassie.eunet.fi with SMTP id AA13901 (5.67a/IDA-1.5 for ); Thu, 17 Oct 1996 16:29:03 +0300 Received: from poveri.tekla.fi by marathon.tekla.fi (5.65/20-jun-90) id AA26393; Thu, 17 Oct 1996 15:29:00 +0200 From: sja@tekla.fi (Sakari Jalovaara) Received: by poveri.tekla.fi; (5.65v3.2/1.1.8.2/20Aug96-0557PM) id AA19172; Thu, 17 Oct 1996 16:28:58 +0300 Date: Thu, 17 Oct 1996 16:28:58 +0300 Message-Id: <9610171328.AA19172@poveri.tekla.fi> To: hackers@freebsd.org Subject: Re: enum considered bad ? 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 don't use enums because C doesn't say what *size* they are. External data (files, networks, hardware) requires knowing how many bits/bytes I'm working with. When I put small integral values in a large array, I say "char foo[10000]". Saves space. When I want a single local/static/global variable, I say "int foo". For single variables, ints are (usually) the fastest type (think "DEC Alpha" here). With enums I can't choose. And different compilers/ABIs pack enums differently. ++sja