Re: KASSERT and clang static analyzer

2017-04-19 Thread J. Lewis Muir
On 04/19, Edgar Fuß wrote: > > But as Taylor Campbell noted, if KASSERT sometimes does not return but > > other times *does* return, then it's problematic for the analyzer since > > it considers an assertion handler to be a function that does not return. > > Isn't analyzer_noreturn made for this?

Re: KASSERT and clang static analyzer

2017-04-19 Thread Edgar Fuß
> But as Taylor Campbell noted, if KASSERT sometimes does not return but > other times *does* return, then it's problematic for the analyzer since > it considers an assertion handler to be a function that does not return. Isn't analyzer_noreturn made for this?

Re: KASSERT and clang static analyzer

2017-04-18 Thread J. Lewis Muir
On 04/18, co...@sdf.org wrote: > Hi, > > I'm trying clang static analyzer. > It seems to assume that KASSERT(a != 0) => test what happens if a == 0 in the > rest of the function > any idea how to convince it to stop doing that? Questions 1, 2, 10, and 11 of the FAQ might be of interest: https

Re: KASSERT and clang static analyzer

2017-04-18 Thread Joerg Sonnenberger
On Tue, Apr 18, 2017 at 10:37:42AM -0700, Alistair Crooks wrote: > or fix clang not to be stupid I don't think the fault is with clang here. All available information says there is a set of conditions that lead to a division by zero. > > Marking kern_assert as __dead should at least let the stati

Re: KASSERT and clang static analyzer

2017-04-18 Thread Alistair Crooks
or fix clang not to be stupid On 18 April 2017 at 09:17, Taylor R Campbell wrote: >> Date: Tue, 18 Apr 2017 19:38:06 +0800 (+08) >> From: Paul Goyette >> >> I looked at the picture, and it seems to me it is doing the same thing >> that it does for any other "if ()" condition. Look just a little

Re: KASSERT and clang static analyzer

2017-04-18 Thread Taylor R Campbell
> Date: Tue, 18 Apr 2017 19:38:06 +0800 (+08) > From: Paul Goyette > > I looked at the picture, and it seems to me it is doing the same thing > that it does for any other "if ()" condition. Look just a little bit > further down and you'll see the same "assumption" on an if that isn't > buried

Re: KASSERT and clang static analyzer

2017-04-18 Thread Taylor R Campbell
> Date: Tue, 18 Apr 2017 09:39:36 + > From: co...@sdf.org > > I'm trying clang static analyzer. > It seems to assume that KASSERT(a != 0) => test what happens if a == 0 in the > rest of the function > any idea how to convince it to stop doing that? > > example output: http://i.imgur.com/AqTm

Re: KASSERT and clang static analyzer

2017-04-18 Thread Paul Goyette
I looked at the picture, and it seems to me it is doing the same thing that it does for any other "if ()" condition. Look just a little bit further down and you'll see the same "assumption" on an if that isn't buried inside a macro. In short, there's nothing wrong, nothing to investigate.

Re: KASSERT and clang static analyzer

2017-04-18 Thread Kamil Rytarowski
On 18.04.2017 11:39, co...@sdf.org wrote: > Hi, > > I'm trying clang static analyzer. > It seems to assume that KASSERT(a != 0) => test what happens if a == 0 in the > rest of the function > any idea how to convince it to stop doing that? > > example output: http://i.imgur.com/AqTm9mq.png > I'm

KASSERT and clang static analyzer

2017-04-18 Thread coypu
Hi, I'm trying clang static analyzer. It seems to assume that KASSERT(a != 0) => test what happens if a == 0 in the rest of the function any idea how to convince it to stop doing that? example output: http://i.imgur.com/AqTm9mq.png I'm building kernel with 'scan-build make -j20' Thanks.