Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Oct 1996 16:28:58 +0300
From:      sja@tekla.fi (Sakari Jalovaara)
To:        hackers@freebsd.org
Subject:   Re: enum considered bad ?
Message-ID:  <9610171328.AA19172@poveri.tekla.fi>

next in thread | raw e-mail | index | archive | help
> 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



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