home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / std / c / 2389 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1.1 KB

  1. Path: sparky!uunet!mcsun!uknet!edcastle!aiai!richard
  2. From: richard@aiai.ed.ac.uk (Richard Tobin)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Character arrays in structures and address alignment -- any standard?
  5. Message-ID: <7022@skye.ed.ac.uk>
  6. Date: 30 Jul 92 15:14:42 GMT
  7. References: <1992Jul28.063356.28005@sq.sq.com> <14216@ksr.com> <Bs5pMJ.3nM@twwells.com>
  8. Organization: Templi Resurgentes Equites Synarchici
  9. Lines: 21
  10.  
  11. In article <Bs5pMJ.3nM@twwells.com> bill@twwells.com (T. William Wells) writes:
  12. >: Please show a strictly conforming program which can tell the difference
  13. >: between "necessary" padding and "unnecessary" padding.
  14.  
  15. >For example:
  16.  
  17. >    printf("%d\n", (offsetof(foo, y) - offset(foo, x)) - sizeof(int));
  18.  
  19. *If* the standard allows "unnecessary" padding, this program is not
  20. strictly conforming.
  21.  
  22. (1.7 Compliance)
  23.  
  24. "A strictly conforming program ... shall not produce output dependent
  25. on any unspecified, undefined, or implementation-defined behavior"
  26.  
  27. -- Richard
  28. -- 
  29. Richard Tobin,
  30. AI Applications Institute,                                R.Tobin@ed.ac.uk
  31. Edinburgh University.
  32.