enum function bug?

John Gilmore gnu at hoptoad.uucp
Mon Sep 29 15:08:03 AEST 1986


I think the definitive word on this has been said already:

Date:  8 Nov 1982 0216-PST (Monday)
From: decwrl!decvax!harpo!npoiv!alice!research!dmr
Subject: enums
Newsgroups: net.lang.c

There has been a lot of grousing about the uselessness of the enum type
in C, most of it justified under the circumstances.  The circumstances
are that all versions of PCC that I know of are buggy in their treatment
of this type.

Enums were intended to be entirely equivalent to ints; just a way, really,
of defining names for constants understood by the compiler and subject
to the normal scope rules.

There was a clear choice here: enums as utterly separate collections of atoms,
more or less as in Pascal, or as ways of naming integers.  I chose the
latter after some waffling.  Unfortunately, some of the waffle batter
got mixed in with PCC and has stayed there.

		Dennis Ritchie
-- 
John Gilmore  {sun,ptsfa,lll-crg,ihnp4}!hoptoad!gnu   jgilmore at lll-crg.arpa
		     May the Source be with you!



More information about the Comp.lang.c mailing list