Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Oct 1996 11:03:25 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        luigi@labinfo.iet.unipi.it (Luigi Rizzo)
Cc:        phk@freebsd.org, hackers@freebsd.org
Subject:   Re: enum considered bad ?
Message-ID:  <199610171803.LAA06082@phaeton.artisoft.com>
In-Reply-To: <199610170804.JAA05315@labinfo.iet.unipi.it> from "Luigi Rizzo" at Oct 17, 96 09:04:01 am

next in thread | previous 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 ?
> 
> 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.



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