🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3059

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

#3059
From: Erik Naggum
Date: Mon, 20 May 1991 16:45
23 lines
1577 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_which_the_\
|   implementation_is_allowed_to_define_even_though_portable_programs_cannot_\
|   directly_name_this_type)

Right.  There's a subtle difference between the type of enumerators
and the enumeration type itself.  Section 3.5.2.2 of dpANS of 1/11/88
(sorry, I have the proper standard at my office) specifies that 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.)

</Erik>
--
Erik Naggum             Professional Programmer            +47-2-836-863
Naggum Software             Electronic Text            <enag@ifi.uio.no>
0118 OSLO, NORWAY       Computer Communications      <erik@naggum.uu.no>
Technical Details
Message-ID: <ENAG.91May20184547@gyda.ifi.uio.no>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!ugle.unit.no!nuug!ifi!enag
References: <5506@lupine.NCD.COM> <ENAG.91May20004919@maud.ifi.uio.no> <1991May20.034617.19896@tkou02.enet.dec.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!ugle.unit.no!nuug!ifi!enag
From: enag@ifi.uio.no (Erik Naggum)
Newsgroups: comp.std.c
Subject: Re: How soon can `sizeof (tagged_type)' be used?
Message-ID: <ENAG.91May20184547@gyda.ifi.uio.no>
Date: 20 May 91 16:45:56 GMT
References: <5506@lupine.NCD.COM> <ENAG.91May20004919@maud.ifi.uio.no>
 <1991May20.034617.19896@tkou02.enet.dec.com>
Sender: enag@ifi.uio.no (Erik Naggum)
Organization: Naggum Software, Oslo, Norway
Lines: 23
In-Reply-To: diamond@jit533.swstokyo.dec.com's message of 20 May 91 03: 46:17 GMT