home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / dsp / 3089 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  1.6 KB

  1. Xref: sparky comp.dsp:3089 comp.lang.c:20173
  2. Newsgroups: comp.dsp,comp.lang.c
  3. Path: sparky!uunet!peora!tarpit!tous!bilver!dandrews
  4. From: dandrews@bilver.uucp (Dave Andrews)
  5. Subject: Re: Is this a Legal Way to Access a Specific Address?
  6. Organization: W. J. Vermillion - Winter Park, FL
  7. Date: Mon, 25 Jan 1993 15:13:08 GMT
  8. Message-ID: <1993Jan25.151308.29650@bilver.uucp>
  9. Keywords: DSP, C, ANSI, Fixed RAM
  10. References: <1993Jan23.042626.991@verdix.com> <1993Jan24.171455.9451@bilver.uucp> <4255@randvax.rand.org>
  11. Lines: 26
  12.  
  13. In article <4255@randvax.rand.org> edhall@rand.org (Ed Hall) writes:
  14. >In article <1993Jan24.171455.9451@bilver.uucp> dandrews@bilver.uucp (Dave Andrews) writes:
  15. >>   float *oc_ptr = (float *) ON_CHIP;
  16. >
  17. >Assignment
  18. >of a properly-cast integer constant (usually in hex or octal format) to
  19. >a pointer is not only legal, there are situations in writing device
  20. >drivers where it is essential.  The value you state is the value you get,
  21. >assuming there are a sufficient number of bits.  Of course, just what
  22. >happens when you use this pointer is highly implementation-specific.
  23. >But the construct itself is legal C.
  24.  
  25. Ah, but is it defined that "the value you state is the value you get"?
  26. Or is this dependent on the implementation?  I don't have a problem
  27. with casting integers to pointers and vice-versa, this is the sort
  28. of quagmire you have to get into when doing e.g. device drivers.
  29.  
  30. I just was uneasy about the use of an integer as an initializer for
  31. a pointer that referred to a type of other than unit size.  I'd feel
  32. better about a pointer of type void.
  33.  
  34. If only I were the king of the world... <audible sigh>.
  35.  
  36. - David Andrews
  37.   dandrews@bilver.oau.org
  38.  
  39.