<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 - Unsequenced warnings displayed inconsistently"
href="https://bugs.llvm.org/show_bug.cgi?id=37999">37999</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Unsequenced warnings displayed inconsistently
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dilyan.palauzov@aegee.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>With this program:
#include <ctype.h>
#include <stdio.h>
int main() {
char g[] = "ABC";
int i =0;
g[i] = tolower(g[i++]);
printf("g=%s, i=%i\n", g, i);
}
and clang 6.0.0 (not 6.0.1) I get:
$ clang -O0 plus.c
plus.c:7:21: warning: unsequenced modification and access to 'i'
[-Wunsequenced]
g[i] = tolower(g[i++]);
~ ^
1 warning generated.
but
$ clang -O1 plus.c
-> No warnings
As the first call (-O0) emits warnings, I would expect that the second call
(-O1) emits the same warnings.</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>