[cfe-commits] [PATCH] Improve -Wtautological-constant-out-of-range-compare

Jordan Rose jordan_rose at apple.com
Mon Nov 12 17:28:23 PST 2012



================
Comment at: test/Analysis/additive-folding.cpp:135-138
@@ -134,6 +134,6 @@
   clang_analyzer_eval(a != 0x100); // expected-warning{{comparison of constant 256 with expression of type 'unsigned char' is always true}} expected-warning{{TRUE}}
-  clang_analyzer_eval(a != -1); // expected-warning{{TRUE}}
+  clang_analyzer_eval(a != -1); // expected-warning{{comparison of constant -1 with expression of type 'unsigned char' is always true}} expected-warning{{TRUE}}
 
-  clang_analyzer_eval(a > -1); // expected-warning{{TRUE}}
-  clang_analyzer_eval(a >= -1); // expected-warning{{TRUE}}
+  clang_analyzer_eval(a > -1); // expected-warning{{comparison of constant -1 with expression of type 'unsigned char' is always true}} expected-warning{{TRUE}}
+  clang_analyzer_eval(a >= -1); // expected-warning{{comparison of constant -1 with expression of type 'unsigned char' is always true}} expected-warning{{TRUE}}
 }
----------------
It would be perfectly fair to disable the warning for this file, since it's supposed to be testing the analyzer rather than the compiler.


http://llvm-reviews.chandlerc.com/D113



More information about the cfe-commits mailing list