Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!genrad!decvax!harpo!floyd!vax135!ariel!houti!hogpc!houxm!ihnp4!ihuxv!portegys
From: portegys@ihuxv.UUCP
Newsgroups: net.lang.c
Subject: C typedef deficiency
Message-ID: <479@ihuxv.UUCP>
Date: Wed, 22-Jun-83 10:38:24 EDT
Article-I.D.: ihuxv.479
Posted: Wed Jun 22 10:38:24 1983
Date-Received: Thu, 23-Jun-83 01:04:27 EDT
Lines: 36

I was suprised to find out recently that C does not allow
identical enumeration names within different data types.  I
am working under UNIX 5.0 on a VAX 11/780.  Here is an example
of what I mean:

----------------------------------------------

typedef enum {
	GREEN,
	RIPE,
	ROTTEN
} APPLE;

typedef enum {
	SOUR,
	JUICY,
	ROTTEN
} ORANGE;

main() {

	ORANGE fruitx;
	APPLE fruity;

	fruitx = ROTTEN;
	fruity = ROTTEN;

}

----------------------------------------------

This program will not compile, due to the redeclared symbol ROTTEN.
I think this is a deficiency of C, since the two values of ROTTEN
apply to different data types.

                             Tom Portegys, BTL IH, ihuxv!portegys