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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 19 06:08:03 PST 2016


aaron.ballman closed this revision.
aaron.ballman marked an inline comment as done.
aaron.ballman added a comment.

Thanks! I've commit in r261324.


================
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) {
----------------
hokein wrote:
> I see in most of testcases, they are using `[[@LINE-1]]` instead of `[[@LINE+1]]`. We'd better follow the `[[@LINE+1]]` way here.
I've changed to using -1 instead of +1, but I don't think we have a hard and fast rule on location aside from "whatever makes the most sense." Given the compound blocks, I personally think +1 is more clear than -1, but meh.


http://reviews.llvm.org/D17387





More information about the cfe-commits mailing list