[cfe-commits] [PATCH][PR11329] StaticAnalyzer: Warn when statement body is a semicolon -- an unintended null statement
Dmitri Gribenko
gribozavr at gmail.com
Tue Jan 3 06:46:59 PST 2012
Hello,
Attached is a patch for clang StaticAnalyzer that implements
enhancement proposed in PR11329.
Commit message:
Add a null statement checker that warns about (possibly) unintended
null statement
(semicolon) as body in for, range-based for, while and switch statements.
Best regards,
Dmitri Gribenko
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: null-stmt-body-checker.patch
Type: text/x-diff
Size: 10966 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120103/7fdf99bf/attachment.patch>
More information about the cfe-commits
mailing list