<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Clang does not warn about div-by-zero"
href="https://bugs.llvm.org/show_bug.cgi?id=35279">35279</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang does not warn about div-by-zero
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>dcoughlin@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>piotr.padlewski@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>For simple program like this:
#include <stdio.h>
#include <stdint.h>
int main() {
printf("%d\n", (((918515801 / ((1974464271 - (1388439940 / 22917248)) +
(((((1878439744 / ((68069159 - 8735854) - 425199211)) * 1941773574) *
1754447815) / ((((((1893352180 * 244104000) + 955373578) / (995528348 *
181952995)) / (1991957413 * ((1942485480 / 752180376) - 857300598))) /
((1232955370 - 531502124) / (1890372242 + (962926980 * 1635678966)))) *
(596143364 - ((1436747303 * ((595136684 - (1632371992 / 1420536269)) *
386470753)) - 799765743)))) / (1597316699 * (1353498314 / (875331973 +
1518013564)))))) - (1517892652 + 1600483064)) / (322521125 - 1964783090)) *
(1982720318 + ((((2124895355 - 1317543403) + ((1773760518 + 1245421820) *
1036317926)) - (946138651 * 291916216)) / ((2101060860 * 1143439799) -
326679758))));;
printf("%d\n", (407267477 + 1458129826) / 1418630932);;
return 0;}
clang (-Wall -Wextra) does not diagnose any division by zero, where gcc shows
couple of them.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>