Re: SMATCH indicates warning to almost all files in Linux Kernel + ARM

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

 



On Fri, Sep 15, 2017 at 3:29 AM, Kuninori Morimoto
<kuninori.morimoto.gx@xxxxxxxxxxx> wrote:
>
> Hi Christopher, Luc
>
> Thank you for your help
>
>> >>   CC      sound/soc/soc-dapm.o
>> >>   CHK     kernel/config_data.h
>> >> linux/arch/arm64/include/asm/lse.h:14:28: warning: Unknown escape 'l'
>> >> linux/arch/arm64/include/asm/lse.h:14:37: warning: Unknown escape 'l'
>> >> linux/arch/arm64/include/asm/alternative.h:172:28: warning: Unknown escape 'o'
> (snip)
>> It seems that ARM has some very interesting assembly
>> directly embed into the C source code. That is not support
>> by sparse. Those section of code is protected by
>> __ASSEMBLY__ macro.
>>
>> Can you try to turn off  __ASSEMBLY__ definition in the
>> sparse invocation?
>
> I tried it, but it couldn't solve my issue.
> Doesn't smatch check #if ? see below.
>
> But it seems this issue was already solved (?)
>
>         > This is solved in sparse since commit f83c2b8f0b5fcb8f60342b5a2fa51a84901f355a:
>         >     "warn on unknown escapes after preprocessing"
>
> I couldn't find this commit on latest smatch git.
> Maybe it will be added/merged for next version ?
> I'm happy to update smatch then :)
>
...

>
> I tried variously things, and it seems smatch doesn't check #if ?
> This lse.h file is this construction.
>
> --- lse.h ----------
>         ...
>         #if defined(CONFIG_AS_LSE) && defined(CONFIG_ARM64_LSE_ATOMICS)

I'm sure that smatch does check #if, but the wrong warnings you saw about the
escaped 'l' & 'o' are issued during tokenization, before the
pre-processing took place.
So using #ifdef __ASSEMBLER  or anything using pre-processing won't help you.
The commit I gave here above is really needed.


Best regards,
-- Luc Van Oostenryck
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux