home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / misc / 4047 < prev    next >
Encoding:
Text File  |  1992-12-16  |  1.6 KB  |  46 lines

  1. Newsgroups: comp.lang.misc
  2. Path: sparky!uunet!walter!news
  3. From: Darren New <dnew@thumper.bellcore.com>
  4. Subject: Re: Safety. Was: Re: Pointers
  5. Message-ID: <1992Dec16.164821.19079@walter.bellcore.com>
  6. Sender: news@walter.bellcore.com
  7. Nntp-Posting-Host: bambam.bellcore.com
  8. Organization: Bellcore
  9. Date: Wed, 16 Dec 92 16:48:21 GMT
  10. Lines: 34
  11.  
  12. I have never seen iasf before. 
  13.  
  14. If memory serves, the body of iasf was posted in the same line where it
  15. was used.  Basically, an inlined-function version of the union punning.
  16.  
  17. > But I am more interested in this for variables than for constants,
  18. > although it is often needed at the present time for constants.
  19.  
  20. It would certainly work for variables.
  21.  
  22. >     use_double(c,d)
  23.  
  24. > where, for example, c and d would be 32-bit objects and double is 64-bit.
  25.  
  26. This is a trivial modification, using a union with two 32-bit objects
  27. overlapping one 64-bit object.
  28.  
  29. However, C cannot choose different functions based on that their value
  30. is returned as.  What should it do if you say
  31.  
  32. process(use_double(c,d))
  33.  
  34. and you haven't declared what types "process" uses returns.  It's a tiny
  35. amount of work to use different functions depending on what you want to
  36. pass and what you want back, compared to actually getting it to work.
  37.  
  38.         -- Darren (can't believe I'm getting pulled into this again) New.
  39.  
  40. Darren New, MTS <dnew@thumper.bellcore.com> (MIME compliant)
  41. 445 South St/MRE 2E-279/Morristown NJ 07960 USA/(201)829-4833
  42. Delivery of Electronic Multimedia over Networks (DEMON)
  43. Also, formal description techniques, programming languages
  44. ``Sometimes, you just have to bite the silver bullet.''
  45.  
  46.