memcpy to an unaligned address

Shaun Jackman sjackman@gmail.com
Tue Aug 2 22:15:00 GMT 2005


On 8/2/05, Joe Buck <Joe.Buck@synopsys.com> wrote:
> I suppose we could make & on an unaligned project return a void*.  That
> isn't really right, but it would at least prevent the cases that we know
> don't work from compiling.

That sounds like a dangerous idea only because I'd expect...
	int *p = &packed_struct.unaligned_member;
... to fail if unaligned_member is not an int, but if the & operator
returns a void*, it would suddenly become very permissive.

Cheers,
Shaun



More information about the Gcc mailing list