home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / std / c / 3432 < prev    next >
Encoding:
Text File  |  1993-01-28  |  2.2 KB  |  43 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!swrinde!sdd.hp.com!zaphod.mps.ohio-state.edu!uwm.edu!cs.utexas.edu!sun-barr!ames!decwrl!pa.dec.com!engage.pko.dec.com!nntpd.lkg.dec.com!jit345.bad.jit.dec.com!diamond
  3. From: diamond@jit345.bad.jit.dec.com (Norman Diamond)
  4. Subject: Re: Structure walking
  5. Message-ID: <1993Jan27.013205.21037@nntpd.lkg.dec.com>
  6. Sender: usenet@nntpd.lkg.dec.com (USENET News System)
  7. Reply-To: diamond@jit.dec.com (Norman Diamond)
  8. Organization: Digital Equipment Corporation Japan , Tokyo
  9. References: <1993Jan25.213543.25499@pony.Ingres.COM> <1993Jan26.013634.20451@nntpd.lkg.dec.com> <C1GHJy.GJp@x.co.uk>
  10. Date: Wed, 27 Jan 1993 01:32:05 GMT
  11. Lines: 30
  12.  
  13. In article <C1GHJy.GJp@x.co.uk> clive@x.co.uk (Clive Feather) writes:
  14. >In article <1993Jan26.013634.20451@nntpd.lkg.dec.com> diamond@jit.dec.com (Norman Diamond) writes:
  15. >>In article <1993Jan25.213543.25499@pony.Ingres.COM> mikes@Ingres.COM (Mike Schilling) writes:
  16. >>>(a) Each scalar type has an unambiguous alignment requirement.
  17.  
  18. >>For all existing C compilers?  Probably.  For all hypothetical standard
  19. >>conforming compilers?  Uncertain.  Actually it is imaginable, for a
  20. >>hypothetical but really meaningful compiler, if space is virtually free
  21. >>but speed is extremely expensive, one might want to align a 4-byte integer
  22. >>in the second half of an 8-byte cache line in order to save time by only
  23. >>filling half of a cache line.  I don't know if you'd call this unambiguous.
  24.  
  25. >ISO 3.1 defines alignment as the requirement for objects of a given type
  26. >to have addresses that are multiples of some number.
  27.  
  28. You're right!  So does ANSI Classic 1.6.  There goes that possible
  29. optimization.
  30.  
  31. >There are no
  32. >requirements for alignment that I can find, except that 6.5.2.1 requires
  33. >the alignment of structure members to be defined by the implementation.
  34.  
  35. That is indeed the (mostly) relevant section, since the original question
  36. was asking about structure members.  The implementation can choose an
  37. arbitrarily obscure alignment technique, as long as it documents it.
  38. However, I don't know if that makes it "unambiguous".
  39. --
  40. Norman Diamond                diamond@jit.dec.com
  41. If this were the company's opinion, I wouldn't be allowed to post it.
  42. Pardon me?  Or do I have to commit a crime first?
  43.