Article View: comp.std.c
Article #1224Re: space optimization involving enum
From: Steve Clamage
Date: Thu, 27 Aug 1992 18:25
Date: Thu, 27 Aug 1992 18:25
32 lines
1330 bytes
1330 bytes
dmm@vnet.ibm.com (dave) writes:
|In <1992Aug26.184220.8236@taumet.com> Steve Clamage writes:
|>If enums are smaller than ints, avoid those too.
|That means that given
| enum c { red, green, blue };
| int f( x ) enum c x; { }
|there is no strictly-conforming way to write a parameter-list prototype
|for the function f.
Correct. Don't use enum parameters if you mix old-style definitions
with prototypes.
| int f( int );
|would be right if enum c were of short or char size. If enum c were
|of int or long size, then
| int f( enum c );
|would be the prototype, right?
We are talking about nonportable code at this point, but that is
basically right. If enums are the same size as int, you could still use
int f(int);
for the prototype.
--
Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
Technical Details
Message-ID:
<1992Aug27.182540.10717@taumet.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!taumet!steveReferences:
<spuler.714711530@coral.cs.jcu.edu.au> <1992Aug25.153909.17977@email.tuwien.ac.at> <17dvn3INNglh@early-bird.think.com> <19920826.124331.137@almaden.ibm.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!sparky!uunet!taumet!steve From: steve@taumet.com (Steve Clamage) Subject: Re: space optimization involving enum Message-ID: <1992Aug27.182540.10717@taumet.com> Organization: TauMetric Corporation References: <spuler.714711530@coral.cs.jcu.edu.au> <1992Aug25.153909.17977@email.tuwien.ac.at> <17dvn3INNglh@early-bird.think.com> <19920826.124331.137@almaden.ibm.com> Date: Thu, 27 Aug 1992 18:25:40 GMT Lines: 32