home *** CD-ROM | disk | FTP | other *** search
- 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
- From: mcdonald@aries.scs.uiuc.edu (J. D. McDonald)
- Newsgroups: comp.lang.c
- Subject: Re: Pointer/address reluctance
- Message-ID: <mcdonald.206@aries.scs.uiuc.edu>
- Date: 14 Aug 92 21:50:12 GMT
- References: <l8kteaINNp2c@exodus.Eng.Sun.COM> <14807@ksr.com>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: UIUC SCS
- Lines: 42
-
- In article <14807@ksr.com> jfw@ksr.com (John F. Woods) writes:
-
- >linden@positive.Eng.Sun.COM (Peter van der Linden) writes:
- >>Can anyone explain the reluctance that some of the experts here
- >>have in equating "pointer" with "address"?
-
- >Because as soon as someone slips and admits that "addresses" are one possible
- >scheme for implementing "pointers", dozens of non-experts start posting
- >ancient misunderstandings and silliness based on how things work on their
- >peecee, thus driving all of the experts to drink heavily. Good Scotch is
- >quite expensive, so the insistance upon the abstract nature of pointers is
- >a cost-saving measure.
-
-
- However, in fact pointers **are** addresses of a sort, and the real
- programmer nees to understand them if they are to do general programming in
- C.
-
- This can, in fact, be proven:
-
- 1) General programming includes all the programming that can, and is,
- done in C
-
- 2) Some C programming is for interaction with devices, for example,
- direct control of devices from programs and/or device drivers if an OS
- uses such beasties.
-
- 3) Some devices use memory mapped magic addresses
-
- 4) IF these can be addressed from C, which is usually the case (for example,
- C code running in "unhosted" mode at the highest privilege level),
- then the usual way to address them is by actually coding the proper bits
- into an integral variable (or in rare cases the integral part of a union)
- and casing to a pointer.
-
- QED.
-
-
- Of course, there are some individuals who aren't interested in such
- things .. or aren't trusted enough to do it.
-
- Doug McDonald
-