home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / std_unix / volume.31 / text0062.txt < prev    next >
Encoding:
Text File  |  1993-07-15  |  1.8 KB  |  37 lines

  1. Submitted-by: gwyn@smoke.brl.mil (Doug Gwyn)
  2.  
  3. In article <1suta6INNd65@rodan.UU.NET> bitbug@netcom.com (James Buster) writes:
  4. >More importantly, the N argument signal handler (where N > 1) and
  5. >event handlers from 1003.4 destroy any hope of strict ANSI C
  6. >compatibility.
  7.  
  8. The real problem is that extra arguments for the same class of functions
  9. that signal() is expected to register for later invocation cannot be
  10. supported on all possible platforms.  This kind of problem is why we
  11. have special <stdarg.h> implementation-provided support for variable-
  12. argument functions, and why X3J11 had to choose between variadic
  13. signal handler function type and one-int argument signal handler
  14. function type (the latter is what was chosen).  I think people have
  15. gotten too used to sloppy programming on systems that let one get
  16. away with it, so that they don't understand why this is a real issue.
  17.  
  18. >Actually, while I'm talking about implementation defined behavior,
  19. >what about the 1003.4a functional interface for threads and the 1003.4
  20. >events interface? They require that you be able to use a `void *' as data.
  21. >One of the committee members told me that you are giving the caller a
  22. >"pointers worth of data". In C, pointers do not, and never have,
  23. >contained data. This strikes me as being totally bogus.
  24.  
  25. Actually the C standard requires that there be some integral type
  26. capable of holding a (converted) object pointer such that it can
  27. be converted back to a pointer (of the same type) and compare
  28. equal to the original pointer value.  However, this does differ
  29. from being able to stash an arbitrary integral value into a
  30. pointer.  If one really needs to do that sort of thing, either the
  31. pointer should be taken as pointing to the actual data or else a
  32. union should be used.
  33.  
  34.  
  35. Volume-Number: Volume 31, Number 65
  36.  
  37.