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