Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: question about an array of enum Message-ID: <14401@smoke.brl.mil> Date: 9 Nov 90 07:09:54 GMT References: <9130019@hpavla.AVO.HP.COM> <1990Nov7.003126.23445@zoo.toronto.edu> <1990Nov8.000847.16340@athena.mit.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 17 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? Yes. In fact it might be nice to allot only as large an integer type as is needed to hold all valid values (enumeration constant values for the type). Enumeration constants themselves are int, but who cares. It's the type we would like to be compact. >If different enums can have different sizes (which seems like a >useful license to grant the compiler) the documentation would >have to state "the algorithm by which the integral types for >enumerations are chosen," not "the [single] integral type." Yes, I would think that the implementation definition should be expected to spell out how the choice is made.