Issue 108049
Summary [clang-tidy] False positive cert-flp30-c for additional floating-point increment in loop
Labels clang-tidy
Assignees
Reporter chrchr-github
    ~~~c++
void f(int N, double delta) {
    double d = 0.0;
    for (int i = 0; i < N; ++i, d += delta) {}
}
~~~
~~~
<source>:3:31: warning: loop induction _expression_ should not have floating-point type [cert-flp30-c]
 3 |     for (int i = 0; i < N; ++i, d += delta) {}
      |
~~~
The loop variable is `i`, which is an integer.
https://godbolt.org/z/8WjhrerdK
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to