This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
legal ruling on aliasing
- From: Bruce Korb <bkorb at veritas dot com>
- To: GCC Development <gcc at gcc dot gnu dot org>
- Cc: Rob Browning <rlb at defaultvalue dot org>
- Date: Mon, 19 May 2003 14:23:51 -0700
- Subject: legal ruling on aliasing
- Reply-to: bkorb at veritas dot com
In another list, the issue was raised whether or not these
two constructs are completely equivalent under the laws of
aliasing:
stumble_t s;
function( (mumble_t*)(void*)&s );
versus:
stumble_t s;
{
void* v = (void*)&s; // scope constrained to following:
function( (mumble_t*)v );
}
In other words, would the compiler be allowed to presume that
function() did not modify `s'? Particularly, could it make
such an assumption in one case and not the other?