Article View: comp.std.c
Article #3109Re: Non-Portable pointer assignment?
From: Tim McDaniel
Date: Fri, 07 Jun 1991 13:54
Date: Fri, 07 Jun 1991 13:54
26 lines
2129 bytes
2129 bytes
In article <1991Jun7.013605.728@tkou02.enet.dec.com> diamond@jit533.swstokyo.dec.com (Norman Diamond) writes:
The answer is very ugly. Some old programs took advantage of being able
to put more than one char in a char constant, since it was really an int.
I would have been quite content to have seen the types and sizes of
'xy' and 'x' differ. (The 'xy' implementation-defined semantics could
have been tighted a bit, too. If sizeof (T) is N, then other parts of
the C standard require that N characters fit into T. Some wording
could have been found to require that multiple-byte character
constants have up to N characters placed in distinct bytes. Or maybe
they just should have been forbidden -- they're fairly useless
anyway.)
Actually [enum constants are int] is one of the few consistent
things around. For example, 3 is not a char even though it fits in
one, and 3 is not a short even though it fits in one.
I've never declared 3 to be a value of a type. Enumeration constants,
however, *are* declared to be within a particular enumeration type.
--
"Of course he has a knife; he always has a knife. We all have knives.
It's 1183 and we're barbarians."
Tim McDaniel Applied Dynamics Int'l.; Ann Arbor, Michigan, USA
Internet: mcdaniel@adi.com UUCP: {uunet,sharkey}!amara!mcdaniel
Technical Details
Message-ID:
<MCDANIEL.91Jun7095413@dolphin.adi.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!caen!umich!sharkey!amara!mcdanielReferences:
<mccX31w164w@cybrspc> <JXey32w164w@dat1hb.north.de> <1991Jun5.085138.21366@prl.dec.com> <1991Jun5.150527.22942@klaava.Helsinki.FI> <MCDANIEL.91Jun6111329@dolphin.adi.com> <1991Jun7.013605.728@tkou02.enet.dec.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!caen!umich!sharkey!amara!mcdaniel From: mcdaniel@adi.com (Tim McDaniel) Newsgroups: comp.std.c Subject: Re: Non-Portable pointer assignment? Message-ID: <MCDANIEL.91Jun7095413@dolphin.adi.com> Date: 7 Jun 91 13:54:13 GMT References: <mccX31w164w@cybrspc> <JXey32w164w@dat1hb.north.de> <1991Jun5.085138.21366@prl.dec.com> <1991Jun5.150527.22942@klaava.Helsinki.FI> <MCDANIEL.91Jun6111329@dolphin.adi.com> <1991Jun7.013605.728@tkou02.enet.dec.com> Sender: news@adi.COM Organization: Applied Dynamics International, Inc.; Ann Arbor, Michigan, USA Lines: 26 In-reply-to: diamond@jit533.swstokyo.dec.com's message of 7 Jun 91 01:36:05 GMT