home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / std / c / 3335 < prev    next >
Encoding:
Text File  |  1993-01-07  |  1.6 KB  |  38 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!stanford.edu!nntp.Stanford.EDU!dkeisen
  3. From: dkeisen@leland.Stanford.EDU (Dave Eisen)
  4. Subject: Re: Struct hack one last time (one last time)
  5. Message-ID: <1993Jan7.221207.13818@leland.Stanford.EDU>
  6. Sender: news@leland.Stanford.EDU (Mr News)
  7. Organization: Sequoia Peripherals, Inc.
  8. Date: Thu, 7 Jan 93 22:12:07 GMT
  9. Lines: 27
  10.  
  11.  
  12. Deleting most of the back and forth here, you know where to
  13. find it if you need it.
  14.  
  15. >|> >>An implementation is allowed to add padding to the end of a struct.
  16. >|> >>Suppose that the implementation adds space to the end of each struct
  17. >|> >>type where it encodes information used for run-time error checking.
  18.  
  19. >How should the poor compiler know WHERE to insert that information.  For malloc
  20. >there might be special handling in the compiler, but consider a library
  21. >memory-allocation routine of my own that returns void * and which does not
  22. >impose a simple relationship between arguments and the size of the
  23. >chunk of memory allocated!
  24.  
  25. This has nothing to do with malloc. The hypothetical compiler
  26. could simply insert this error checking information whenever
  27. it does a conversion from a (void *) to a (struct foo *). Again,
  28. the basic question is still unresolved here: can a conversion
  29. from one pointer type to another affect bytes other than those
  30. where the pointer variable is stored?
  31.  
  32.  
  33. -- 
  34. Dave Eisen                               Sequoia Peripherals: (415) 967-5644
  35. dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
  36.        There's something in my library to offend everybody. 
  37.           --- Washington Coalition Against Censorship
  38.