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

  1. Xref: sparky comp.lang.c:20182 comp.std.c:3416
  2. Path: sparky!uunet!psinntp!heimdall!thor!scjones
  3. From: scjones@thor.sdrc.com (Larry Jones)
  4. Newsgroups: comp.lang.c,comp.std.c
  5. Subject: Re: Is this a Legal Way to Access a Specific Address?
  6. Keywords: C, ANSI
  7. Message-ID: <556@heimdall.sdrc.com>
  8. Date: 25 Jan 93 18:37:55 GMT
  9. References: <1993Jan23.042626.991@verdix.com> <1993Jan23.181029.29389@uvm.edu> <1993Jan24.172132.9708@bilver.uucp>
  10. Sender: news@heimdall.sdrc.com
  11. Followup-To: comp.std.c
  12. Lines: 29
  13.  
  14. In article <1993Jan24.172132.9708@bilver.uucp>, dandrews@bilver.uucp (Dave Andrews) writes:
  15. > In article <1993Jan23.181029.29389@uvm.edu> wollman@sadye.emba.uvm.edu (Garrett Wollman) writes:
  16. > >The ANSI C standard
  17. > >*does* guarantee (I believe, not having a copy handy) that there is
  18. > >some flavor of integer that can be cast back and forth to a pointer
  19. > >type. 
  20. > Could you verify this?  (I don't have a copy, handy or not)  I seem 
  21. > to remember that some pathological machines (AS/400 e.g.) have
  22. > "pointers" that are much longer than integers of ANY type.
  23.  
  24. On the contrary, the ANSI standard makes no such guarantee.  ANSI 3.3.4
  25. Cast Operators:
  26.     A pointer may be converted to an integral type.  The size of
  27.     integer required and the result are implementation-defined.  If
  28.     the space provided is not long enough, the behavior is undefined.
  29.  
  30.     An arbitrary integer may be converted to a pointer.  The result
  31.     is implementation-defined.
  32.  
  33. Note that there is no guarantee that *any* integral type is large enough,
  34. nor is there any guarantee that the mapping is invertible.
  35.  
  36. (Also note, please, that questions about C standards belong in comp.std.c
  37. to which I have cross-posted and redirected followups.)
  38. ----
  39. Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
  40. larry.jones@sdrc.com
  41. Hello, local Navy recruitment office?  Yes, this is an emergency... -- Calvin
  42.