Article View: comp.dsp
Article #2108Re: Is this a Legal Way to Access a Specific Address?
From: Steve Clamage
Date: Mon, 25 Jan 1993 17:00
Date: Mon, 25 Jan 1993 17:00
24 lines
1502 bytes
1502 bytes
>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. Not quite. It is legal to cast an integer value to a pointer type, and legal to cast a pointer value to an integer type. The results are implementation-defined, which means that such code is not portable. Further, it is not guaranteed that there exists an integer type which is large enough to contain all the bits in a pointer. For example, implementations with 48-bit pointers and 32-bit longs exist, and are allowed by the C Standard. Similarly, there are implementations where pointers cannot contain all possible integer values, and this is also allowed. Implementations commonly allow casting back and forth between ints (or longs) and pointers, but you have to check the compiler manual to see what is actually supported. -- Steve Clamage, TauMetric Corp, steve@taumet.com
Technical Details
Message-ID:
<1993Jan25.170044.20283@taumet.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!taumet!steveReferences:
<1993Jan23.042626.991@verdix.com> <1993Jan23.181029.29389@uvm.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.dsp,comp.lang.c Path: arc1-ca.pugleaf.net!sparky!uunet!taumet!steve From: steve@taumet.com (Steve Clamage) Subject: Re: Is this a Legal Way to Access a Specific Address? Message-ID: <1993Jan25.170044.20283@taumet.com> Keywords: DSP, C, ANSI, Fixed RAM Organization: TauMetric Corporation References: <1993Jan23.042626.991@verdix.com> <1993Jan23.181029.29389@uvm.edu> Date: Mon, 25 Jan 1993 17:00:44 GMT Lines: 24