Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!jarthur!elroy.jpl.nasa.gov!ames!zodiac!anders@penguin From: anders@penguin (Anders Wallgren) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW compiler bugs (was: interface war) Message-ID: <10865@zodiac.ADS.COM> Date: 14 Feb 90 20:03:31 GMT References: <1990Feb14.004350.14475@oracle.com> Sender: news@zodiac.ADS.COM Reply-To: anders@penguin (Anders Wallgren) Organization: Verity Lines: 48 In-reply-to: gstein@oracle.com (Greg Stein) Also, try the following: #include enum test_enum { enum_1 = 1, enum_2 = 2, enum_3 = 3, enum_4 = 4, }; typedef struct { int val_int; unsigned char *val_string; } TEST_STRUCT; void main(void) { enum test_enum type; TEST_STRUCT uval,*uvalp; int val; type = enum_4 uval.val_int = 1; uvalp = &uval; val = 1; type = (enum test_enum)(uval.val_int); printf("struct and cast: type is %d (this should be 1)\n", type); type = enum_4 type = uval.val_int; printf("struct, no cast: type is %d (this should be 1)\n", type); type = enum_4; type = (enum test_enum)(uvalp->val_int); printf("struct and cast through pointer: type is %d (this should be 1)\n", type); type = enum_4; type = uvalp->val_int; printf("struct, no cast, through pointer: type is %d (this should be 1)\n", type); type = enum_4; } This won't work in 3.1b1 or 3.1 final.