home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / std / cplus / 1912 < prev    next >
Encoding:
Internet Message Format  |  1992-12-24  |  2.1 KB

  1. Xref: sparky comp.std.c++:1912 comp.std.c:3265
  2. Newsgroups: comp.std.c++,comp.std.c
  3. 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
  4. From: diamond@jit533.jit.dec.com (Norman Diamond)
  5. Subject: Re: Question about sizeof in C/C++.
  6. Message-ID: <Bzqr7A.vJ@jrd.dec.com>
  7. Sender: usenet@jrd.dec.com (USENET News System)
  8. Nntp-Posting-Host: jit533.jit.dec.com
  9. Reply-To: diamond@jit.dec.com (Norman Diamond)
  10. Organization: Digital Equipment Corporation Japan , Tokyo
  11. References: <1992Dec18.021610.24482@nntpd.lkg.dec.com> <cuX5VB1w164w@amfent.Gwinnett.COM>
  12. Date: Thu, 24 Dec 1992 02:06:45 GMT
  13. Lines: 29
  14.  
  15. In article <cuX5VB1w164w@amfent.Gwinnett.COM> amf@amfent.Gwinnett.COM (Andy Feibus) writes:
  16. >diamond@jit345.bad.jit.dec.com (Norman Diamond) writes:
  17. >>In article <wwJXVB3w164w@amfent.Gwinnett.COM> amf@amfent.Gwinnett.COM (Andy F
  18. >>>jamesc@swapsdev.state.state.COM.AU (James Cribb) writes:
  19. >>>>do the C or C++ standards guarantee that &ps[k] ==  [...]
  20. >>>the answer is... no.
  21. >>He was asking about the standards [...] the answer is... yes.
  22.  
  23. >he also asked:
  24. >>>>is it portable?
  25. >And that was the question I answered.
  26. >>>Different compilers see &ps[k] differently; use parentheses to clarify:
  27. >>> &(ps[k]).
  28. >>Even K&R-1 and Stroustrop-1 prohibited seeing this expression differently.
  29.  
  30. >That's nice in theory, but I've found at least one UNIX-based compiler 
  31. >that interprets it differently.  Since his question was about portability,
  32.  
  33. OK, you found at least one UNIX-based compiler for a non-C language.
  34. I've found various compilers with various bugs too.  If you assert that
  35. portability means porting to broken compilers, then there is no such thing
  36. as a portable program.  Zero.  Zilch.  I think the original poster was
  37. asking about portability among standard conforming implementations.  In
  38. fact, even among pre-standard implementations of the C and C++ languages,
  39. portability was there.
  40. --
  41. Norman Diamond       diamond@jit081.enet.dec.com
  42. If this were the company's opinion, I wouldn't be allowed to post it.
  43. "It's been a lovely recession."
  44.