[cfe-dev] [analyser] memset arguments checker
Alexey Knyshev via cfe-dev
cfe-dev at lists.llvm.org
Wed Dec 13 04:54:29 PST 2017
Hi all
I have an idea for memset checker for handling accidental args swap such as:
struct A { ... };
...
struct A a;
memset(&a, sizeof(struct A), 0); // expected-warning {{possibly wrong order
of arguments 'sizeof(struct A)' and '0' passed as arguments 'value' and
'num'}}
...
Probably it can be AST checker but in some cases it can be more precise if
it would be extension of CStringChecker. Any suggestions in which way is
more robust for such checker.
Thanks, Alexey K
--
linkedin.com/profile
<https://www.linkedin.com/profile/view?id=AAMAABn6oKQBDhBteiQnWsYm-S9yxT7wQkfWhSw>
github.com/alexeyknyshev
bitbucket.org/alexeyknyshev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20171213/0a84e447/attachment.html>
More information about the cfe-dev
mailing list