3 ms·
I will let clang's amazingly detailed error messages speak for themselves: ben@burnination ~ $ cat test.c int main() { int a = 3; int b = 2;
by ben509 9y ago
I will let clang's amazingly detailed error messages speak for themselves:
ben@burnination ~ $ cat test.c
int main() {
int a = 3;
int b = 2;
if (a=b) {
return 1;
} else {
return 0;
}
}
ben@burnination ~ $ clang -Wall test.c
test.c:4:10: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (a=b) {
~^~
test.c:4:10: note: place parentheses around the assignment to silence this warning
if (a=b) {
^
( )
test.c:4:10: note: use '==' to turn this assignment into an equality comparison
if (a=b) {
^
==
1 warning generated.