From: Eric Sunshine Date: Tue, 29 Dec 2015 06:42:45 GMT Subject: Re: [PATCH 2/2] bswap: add NO_UNALIGNED_LOADS define Message-ID: In-Reply-To: <20151229063600.GB30340@sigill.intra.peff.net> On Tue, Dec 29, 2015 at 1:36 AM, Jeff King wrote: > The byte-swapping code automatically decides, based on the > platform, whether it is sensible to cast an do a potentially s/an/and/ or something? > unaligned ntohl(), or to pick individual bytes out of an > array. > > It can be handy to override this decision, though, when > turning on compiler flags that will complain about unaligned > loads (such as -fsanitize=undefined). This patch adds a > macro check to make this possible. > > There's no nice Makefile knob here; this is for prodding at > Git's internals, and anybody using it can set > "-DNO_UNALIGNED_LOADS" in the same place they are setting up > "-fsanitize". > > Signed-off-by: Jeff King