Re: [PATCH maint-1.6.5] block-sha1: avoid unaligned accesses on some big-endian systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 14, 2012 at 12:50 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> After the patch, what reason does gcc have to expect that 'block' is
> 32-bit aligned except when it is?  The code (including the code I
> didn't touch) never casts from char * to int * except in get/put_be32
> on arches that don't mind unaligned accesses.

Ahh. I was looking at the cast you added:

    blk_SHA1_Block(ctx, (const unsigned char *) ctx->W);

but I guess that if gcc inlines that and sees the original int type,
it doesn't matter, because that *is* aligned.

So it's ok, but please just make blk_SHA1_Block() take a "const void
*" instead and that cast can go away.

               Linus
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]