home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12349 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  2.0 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!aries.scs.uiuc.edu!mcdonald
  2. From: mcdonald@aries.scs.uiuc.edu (J. D. McDonald)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Pointer/address reluctance
  5. Message-ID: <mcdonald.206@aries.scs.uiuc.edu>
  6. Date: 14 Aug 92 21:50:12 GMT
  7. References: <l8kteaINNp2c@exodus.Eng.Sun.COM> <14807@ksr.com>
  8. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  9. Organization: UIUC SCS
  10. Lines: 42
  11.  
  12. In article <14807@ksr.com> jfw@ksr.com (John F. Woods) writes:
  13.  
  14. >linden@positive.Eng.Sun.COM (Peter van der Linden) writes:
  15. >>Can anyone explain the reluctance that some of the experts here
  16. >>have in equating "pointer" with "address"?
  17.  
  18. >Because as soon as someone slips and admits that "addresses" are one possible
  19. >scheme for implementing "pointers", dozens of non-experts start posting
  20. >ancient misunderstandings and silliness based on how things work on their
  21. >peecee, thus driving all of the experts to drink heavily.  Good Scotch is
  22. >quite expensive, so the insistance upon the abstract nature of pointers is
  23. >a cost-saving measure.
  24.  
  25.  
  26. However, in fact pointers **are** addresses of a sort, and the real
  27. programmer nees to understand them if they are to do general programming in
  28. C.
  29.  
  30. This can, in fact, be proven:
  31.  
  32. 1) General programming includes all the programming that can, and is,
  33.    done in C
  34.  
  35. 2) Some C programming is for interaction with devices, for example,
  36.    direct control of devices from programs and/or device drivers if an OS
  37.    uses such beasties.
  38.  
  39. 3) Some devices use memory mapped magic addresses
  40.  
  41. 4) IF these can be addressed from C, which is usually the case (for example,
  42.    C code running in   "unhosted" mode at the highest privilege level),
  43.    then the usual way to address them  is by actually coding the proper bits
  44.    into an integral variable (or in rare cases the integral part of a union)
  45.    and casing to a pointer.
  46.  
  47. QED.
  48.  
  49.  
  50. Of course, there are some individuals who aren't interested in such 
  51. things ..  or aren't trusted enough to do it.
  52.  
  53. Doug McDonald   
  54.