home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.std.c++:1912 comp.std.c:3265
- Newsgroups: comp.std.c++,comp.std.c
- Path: sparky!uunet!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!rdg.dec.com!uvo.dec.com!e2big.mko.dec.com!jrdzzz.jrd.dec.com!jit533.jit.dec.com!diamond
- From: diamond@jit533.jit.dec.com (Norman Diamond)
- Subject: Re: Question about sizeof in C/C++.
- Message-ID: <Bzqr7A.vJ@jrd.dec.com>
- Sender: usenet@jrd.dec.com (USENET News System)
- Nntp-Posting-Host: jit533.jit.dec.com
- Reply-To: diamond@jit.dec.com (Norman Diamond)
- Organization: Digital Equipment Corporation Japan , Tokyo
- References: <1992Dec18.021610.24482@nntpd.lkg.dec.com> <cuX5VB1w164w@amfent.Gwinnett.COM>
- Date: Thu, 24 Dec 1992 02:06:45 GMT
- Lines: 29
-
- In article <cuX5VB1w164w@amfent.Gwinnett.COM> amf@amfent.Gwinnett.COM (Andy Feibus) writes:
- >diamond@jit345.bad.jit.dec.com (Norman Diamond) writes:
- >>In article <wwJXVB3w164w@amfent.Gwinnett.COM> amf@amfent.Gwinnett.COM (Andy F
- >>>jamesc@swapsdev.state.state.COM.AU (James Cribb) writes:
- >>>>do the C or C++ standards guarantee that &ps[k] == [...]
- >>>the answer is... no.
- >>He was asking about the standards [...] the answer is... yes.
-
- >he also asked:
- >>>>is it portable?
- >And that was the question I answered.
- >>>Different compilers see &ps[k] differently; use parentheses to clarify:
- >>> &(ps[k]).
- >>Even K&R-1 and Stroustrop-1 prohibited seeing this expression differently.
-
- >That's nice in theory, but I've found at least one UNIX-based compiler
- >that interprets it differently. Since his question was about portability,
-
- OK, you found at least one UNIX-based compiler for a non-C language.
- I've found various compilers with various bugs too. If you assert that
- portability means porting to broken compilers, then there is no such thing
- as a portable program. Zero. Zilch. I think the original poster was
- asking about portability among standard conforming implementations. In
- fact, even among pre-standard implementations of the C and C++ languages,
- portability was there.
- --
- Norman Diamond diamond@jit081.enet.dec.com
- If this were the company's opinion, I wouldn't be allowed to post it.
- "It's been a lovely recession."
-