diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2016-02-19 14:03:20 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2016-02-19 14:03:20 +0000 |
commit | 611d2e4ee6a5150b45659abafd76e5917d4382a7 (patch) | |
tree | 3872485262322b245a83bc1c270fba2f39c1b786 /clang-tools-extra/docs/clang-tidy | |
parent | 7ca8a826f407e4d408e503afa14df9b7f147ba11 (diff) | |
download | bcm5719-llvm-611d2e4ee6a5150b45659abafd76e5917d4382a7.tar.gz bcm5719-llvm-611d2e4ee6a5150b45659abafd76e5917d4382a7.zip |
Add a new check, cert-flp30-c, that diagnoses loop induction expressions of floating-point type. This check corresponds to the CERT secure coding rule: https://www.securecoding.cert.org/confluence/display/c/FLP30-C.+Do+not+use+floating-point+variables+as+loop+counters
llvm-svn: 261324
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy')
-rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/cert-flp30-c.rst | 11 | ||||
-rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/list.rst | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-flp30-c.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-flp30-c.rst new file mode 100644 index 00000000000..cfccb77a53b --- /dev/null +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-flp30-c.rst @@ -0,0 +1,11 @@ +.. title:: clang-tidy - cert-flp30-c + +cert-flp30-c +============ + +This check flags ``for`` loops where the induction expression has a floating- +point type. + +This check corresponds to the CERT C Coding Standard rule +`FLP30-C. Do not use floating-point variables as loop counters +<https://www.securecoding.cert.org/confluence/display/c/FLP30-C.+Do+not+use+floating-point+variables+as+loop+counters>`_. diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst index 4c2795e29ba..b19a7eb7558 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst @@ -13,6 +13,7 @@ Clang-Tidy Checks cert-err60-cpp cert-err61-cpp (redirects to misc-throw-by-value-catch-by-reference) <cert-err61-cpp> cert-fio38-c (redirects to misc-non-copyable-objects) <cert-fio38-c> + cert-flp30-c cert-oop11-cpp (redirects to misc-move-constructor-init) <cert-oop11-cpp> cppcoreguidelines-pro-bounds-array-to-pointer-decay cppcoreguidelines-pro-bounds-constant-array-index |