Xref: utzoo comp.bugs.4bsd:1664 comp.std.c:4178 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!bloom-beacon!deccrl!news.crl.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jit345!diamond From: diamond@jit345.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.bugs.4bsd,comp.std.c Subject: Re: Bug in users command Message-ID: <1991Jan24.060113.22461@tkou02.enet.dec.com> Date: 24 Jan 91 06:01:13 GMT References: <6182:Jan2222:06:3991@kramden.acf.nyu.edu> <18981@rpp386.cactus.org> <12360:Jan2320:15:5291@kramden.acf.nyu.edu> <1991Jan24.004044.13362@craycos.com> Sender: news@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit345.enet@tkou02.enet.dec.com (Norman Diamond) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 22 In article <1991Jan24.004044.13362@craycos.com> pmk@craycos.com (Peter Klausler) writes: >Given the declaration > char (*a)[N]; >the expressions > (char *) a > &((*a)[0]) > *a >are all valid in ANS X3.159-1989, all of type "char *", and all yield pointers >to the same char object. No. The last two yield pointers to the same char object, the first char in *a. The first one coerces a pointer-to-array to a pointer-to-char value. The standard guarantees that you can take a pointer-to-something, cast it to a pointer-to-char, cast it back to a pointer-to-something, and the result is equivalent to the original pointer. It does not guarantee that the value with type pointer-to-char can actually be used for anything. -- Norman Diamond diamond@tkov50.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it.