<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><div><div style="font-family: Calibri,sans-serif; font-size: 11pt;">I remember seeing something about the static analyzer checking asserts in the docs, how well does that actually work?<br><br>sent from my (stupid) windows phone</div></div><div dir="ltr"><hr><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">From: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:cfe-dev@lists.llvm.org">Devin Coughlin via cfe-dev</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Sent: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">‎4/‎7/‎2016 7:28 PM</span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">To: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:apelete@seketeli.net">Apelete Seketeli</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Cc: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:cfe-dev@lists.llvm.org">cfe-dev</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Subject: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">Re: [cfe-dev] Reporting false positives detected by Clang staticanalyzer</span><br><br></div><br>> On Apr 7, 2016, at 1:19 PM, Apelete Seketeli via cfe-dev <cfe-dev@lists.llvm.org> wrote:<br>> <br>> Is there a way to report/declare such false positives in order to<br>> filter them out in the subsequent runs of the static analyzer ?<br><br>Unfortunately, there is not a holistic mechanism for suppressing false positives from subsequent analyzer runs.<br><br>For many false positives, there is some underlying invariant that the analyzer doesn’t understand. For these, you can often add a carefully-placed assert() to then code to tell the analyzer about the invariant (and get dynamic checking of the invariant when assertions are enabled!). You can also hide code from the analyzer with:<br><br>#ifndef __clang_analyzer__<br>// Code not to be analyzed<br>#endif<br><br>There is a FAQ describing these suppression mechanisms and others at <http://clang-analyzer.llvm.org/faq.html>.<br><br>Devin<br>_______________________________________________<br>cfe-dev mailing list<br>cfe-dev@lists.llvm.org<br>http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br></body></html>