Re: Re: Re: Re: Re: about using smatch in all debian C code

李书畅 <[email protected]> Sun, 10 Mar 2024 12:56:47 +0800 (GMT+08:00)
Newsgroups org.kernel.vger.smatch
Message-ID <[email protected]>
Hello Dan, this time I tried to use smatch in a simpler C project named NtyCo, 
Its program address is : https://github.com/wangbojing/NtyCo.
And I tried CHECK="/home/lsc20011130/smatch/smatch -p=NtyCo" CC=/home/lsc20011130/smatch/cgcc make, it seems worked.
then I tried /home/lsc20011130/smatch/smatch -p=NtyCo --foo --bar --/home/lsc20011130/NtyCo/core/nty_epoll.c.
But it doesn't output anything (even though I put some obvious error code in the C file),
I want to know which of my steps went wrong.

regards,
Lishu Chang

 


> -----原始邮件-----
> 发件人: "Dan Carpenter" <[email protected]>
> 发送时间: 2024-03-07 17:49:00 (星期四)
> 收件人: "李书畅" <[email protected]>
> 抄送: [email protected]
> 主题: Re: Re: Re: Re: about using smatch in all debian C code
> 
> I figured it out.  You need to:
> 
> export CHECK="/home/user/smatch/smatch --file-output"
> 
> Then you can't use ~/ in the --cc option.  It has to be
> /home/user/smatch/cgcc.  But then Smatch/Sparse still doesn't compile
> the code correctly.  There are tons of compile errors.  This is really
> a Sparse problem (Smatch uses Sparse as a parser).  I suspect that
> fixing it will be difficult.
> 
> regards,
> dan carpenter