https://bugs.llvm.org/show_bug.cgi?id=37999
Bug ID: 37999
Summary: Unsequenced warnings displayed inconsistently
Product: clang
Version: 6.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: dilyan.palau...@aegee.org
CC: llvm-bugs@lists.llvm.org
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs