clangでコンパイルすると次のようなWARNING。
mugen.c:6:15: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
for (--i; i >= 0; --i) {
~ ^ ~
1 warning generated.
gccだと-Wみたいなオプションつけると似たような警告。
| #include <stdio.h> | |
| int main() { | |
| unsigned int i = 0; | |
| for (--i; i >= 0; --i) { | |
| printf("%u\n", i); | |
| } | |
| } |