🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3060

Re: How soon can `sizeof (tagged_type)' be used?

#3060
From: Norman Diamond
Date: Tue, 21 May 1991 00:55
19 lines
1732 bytes
Erik Naggum writes:
>|   What is "sizeof (enum E)" supposed to return if not the same as
>|   "sizeof (int)"?
Norman Diamond writes:
>|   sizeof (short), sizeof (long), or sizeof (other_integral_type...)
Erik Naggum:
>Right.  There's a subtle difference between the type of enumerators
>and the enumeration type itself. ... the former have type int, while
>the enumerated type "shall be compatible with an integer type; the choice
>of type is implementation-defined".  (Why this is so escapes me.)

Variables can be declared with the enumeration type, and their storage
requirements are determined accordingly.  But enumerators are just constants.
The constants 5200 and 'x', for example, have type int, even though they can
fit in shorts; but they're just constants and aren't necessarily stored.
--
Norman Diamond       diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Permission is granted to feel this signature, but not to look at it.
Technical Details
Message-ID: <1991May21.005938.4839@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!jit533!diamond
References: <5506@lupine.NCD.COM> <ENAG.91May20004919@maud.ifi.uio.no> <1991May20.034617.19896@tkou02.enet.dec.com> <ENAG.91May20184547@gyda.ifi.uio.no>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!jit533!diamond
From: diamond@jit533.swstokyo.dec.com (Norman Diamond)
Newsgroups: comp.std.c
Subject: Re: How soon can `sizeof (tagged_type)' be used?
Message-ID: <1991May21.005938.4839@tkou02.enet.dec.com>
Date: 21 May 91 00:55:59 GMT
References: <5506@lupine.NCD.COM> <ENAG.91May20004919@maud.ifi.uio.no> <1991May20.034617.19896@tkou02.enet.dec.com> <ENAG.91May20184547@gyda.ifi.uio.no>
Sender: usenet@tkou02.enet.dec.com (USENET News System)
Reply-To: diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond)
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 19