This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: dewar at gnat dot com
- To: dewar at gnat dot com, paulus at samba dot org
- Cc: gcc at gcc dot gnu dot org, linux-kernel at vger dot kernel dot org,trini at kernel dot crashing dot org, velco at fadata dot bg
- Date: Sun, 6 Jan 2002 08:07:01 -0500 (EST)
- Subject: Re: [PATCH] C undefined behavior fix
<<* Given an address as an int (of the appropriate size), I need a way
to construct a pointer, which when dereferenced, will result in the
CPU presenting that address to the MMU.
* I need a way to tell the compiler not to make any assumptions about
what objects that such a pointer might or might not point to, so
that the effect of dereferencing the pointer is simply to access the
memory at the address I gave, and is not considered "undefined"
regardless of how I might have constructed the address.
>>
So that seems reasonable as a statement of need (i.e. a high level
requirement), so what is needed now is to craft a well defined way
in GNU C, preferably other than ASM inserts, to achieve this very
reasonable goal.