On Mon, Mar 03, 2003 at 10:01:39PM +0100, Eric Pouech wrote:
Michael Stefaniuc wrote:
On Mon, Mar 03, 2003 at 07:01:35PM +0100, Eric Pouech wrote:
- while (*lpszStr);
- while (*lpszStr)
could we catch this type of error with smatch ?
It's pretty easy to check for "(while|for)(....);", but the interesting part is to keep the false positive minimal. I'll see what i can do.
look for: if (...); (while|for)(...);{ };while
should limit false positives
That's even easier in smatch, i have to just check for: (if|for|while)_cond end_(if|for|while)
but that's still a lot of false positives. One false positive (real code) is: while (*p++ != 0x4D && p < pend);
I need to check what's inside the () too. I'm looking at the moment at the false positives to know what to look for.
bye michael