Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: question about an array of enum Message-ID: <4221@goanna.cs.rmit.oz.au> Date: 8 Nov 90 01:04:51 GMT References: <9130019@hpavla.AVO.HP.COM> <1990Nov8.000847.16340@athena.mit.edu> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 18 In article <1990Nov8.000847.16340@athena.mit.edu>, scs@adam.mit.edu (Steve Summit) writes: > Does the standard really allow a different choice to be made for > different enumerations? Consider the following program fragment: enum foo *p; ... { ... f((char*)p); ... } ... enum foo {a,b,c}; Last time I tried that in a C program it worked. But on a machine where byte pointers and word pointers have different formats, the compiler needs to know what casting p to (char*) involves. Such a machine's C compiler could of course always use 'int'. -- The problem about real life is that moving one's knight to QB3 may always be replied to with a lob across the net. --Alasdair Macintyre.