Closed
Description
Bugzilla Link | 18504 |
Version | trunk |
OS | Linux |
CC | @zygoloid,@zhendongsu |
Extended Description
Clang does not emit a warning for the comparison of integers of different signs.
I have the following program:
int unreported(unsigned a, int *b) {
return a > (~(95 != *b));
}
And compile it with the following command, but Clang emits no warning for the expression "a > (~(95 != *b))"
$clang -Wall -Wextra -std=c11 -pedantic -c s.c
$clang --version
clang version 3.5 (trunk 198918)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Differently, GCC emits a warning with the following command
gcc -Wall -Wextra -std=c11 -pedantic -c s.c
s.c: In function ‘unreported’:
s.c:7:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return a > (~(95 != *b));
^