[PATCH] D17387: Add check for CERT FLP30-C

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 19 01:36:53 PST 2016


hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.

LGTM with one nit.


================
Comment at: test/clang-tidy/cert-flp30-c.c:6
@@ +5,3 @@
+void func(void) {
+  // CHECK-MESSAGES: :[[@LINE+1]]:37: warning: loop induction expression should not have floating-point type [cert-flp30-c]
+  for (float x = 0.1f; x <= 1.0f; x += 0.1f) {
----------------
I see in most of testcases, they are using `[[@LINE-1]]` instead of `[[@LINE+1]]`. We'd better follow the `[[@LINE+1]]` way here.


http://reviews.llvm.org/D17387





More information about the cfe-commits mailing list