Re: [PATCH] sh: pass machine size to sparse

From: Rob Landley
Date: Wed May 30 2018 - 10:41:41 EST


On 05/28/2018 11:40 AM, Luc Van Oostenryck wrote:
> By default, sparse assumes a 64bit machine when compiled on x86-64
> and 32bit when compiled on anything else.
>
> This can of course create all sort of problems, like issuing false
> warnings like: 'shift too big (32) for type unsigned long', or
> worse, to not emit legitimate warnings.
>
> Fix this by passing to sparse the appropriate -m32/-m64 flag

$ ${CROSS_COMPILE}gcc -E -dM - < /dev/null | grep __SIZEOF_LONG__
#define __SIZEOF_LONG__ 8

You can ask the compiler, you don't need to redundantly add this to every
architecture's Makefile.

Rob