<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><base href="x-msg://230/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi, Sujit. The checkers in the analyzer can choose to treat errors as fatal or non-fatal. In the case of divide-by-zero errors, we treat them as fatal, because (a) they will in fact trap in most runtimes, and (b) it's hard to continue evaluating if the division is used in a larger expression:</div><div><br></div><div>int a = 23 / 0;</div><div>int b = 34 / a; // ??</div><div><br></div><div>Note that the analyzer only stops analyzing a particular <i>path</i> when it sees a fatal error, not the entire file. Both divide-by-zero violations should be reported in compute(), as well as the one in again(), even if both functions are in the same file.</div><div><br></div><div>int compute(int a) {</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>if (coin()) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>a = a / 0;</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>} else {</div><div><span class="Apple-tab-span" style="white-space:pre">             </span>a = a / 0;</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>}</div><div>}</div><div><br></div><div>int again() {</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>return 24 / 0;</div><div>}</div><div><br></div><div>Best,</div><div>Jordan</div><div><br></div><div><br></div><br><div><div>On Dec 11, 2012, at 1:36 , Sujit Kamthe <<a href="mailto:Sujit.Kamthe@kpitcummins.com">Sujit.Kamthe@kpitcummins.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Trebuchet MS', sans-serif; color: rgb(23, 54, 93); ">Hi,<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Trebuchet MS', sans-serif; color: rgb(23, 54, 93); ">While running clang tool on a code it was found that if there are multiple divide by zero violations(more than 1) in same file then only the first one is reported and rest of them are not reported.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Trebuchet MS', sans-serif; color: rgb(23, 54, 93); ">Even it was found that when a Prestmt<BinaryOperator> check detects/emits a bugreport, it skips the subsequent binary operator nodes from the same file.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Trebuchet MS', sans-serif; color: rgb(23, 54, 93); "> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Trebuchet MS', sans-serif; color: rgb(23, 54, 93); ">Example Code:<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Trebuchet MS', sans-serif; color: rgb(23, 54, 93); "> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Trebuchet MS', sans-serif; color: rgb(23, 54, 93); ">int a=23/0; //Detected and reported<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Trebuchet MS', sans-serif; color: rgb(23, 54, 93); ">int b=34/0; //Not detected<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: 'Trebuchet MS', sans-serif; color: rgb(23, 54, 93); "> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 8pt; font-family: 'Courier New'; color: rgb(31, 73, 125); ">Regards,</span><span style="font-family: 'Courier New'; color: rgb(31, 73, 125); "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><b><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(84, 141, 212); ">Sujit Kamthe<o:p></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div><br clear="all">This message contains information that may be privileged or confidential and is the property of the KPIT Cummins Infosystems Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins Infosystems Ltd. does not accept any liability for virus infected mails. _______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" style="color: purple; text-decoration: underline; ">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" style="color: purple; text-decoration: underline; ">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></div></blockquote></div><br></body></html>