[PATCH] D35932: [clang-tidy] Add integer division check
Reka Kovacs via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 27 00:06:26 PDT 2017
rnkovacs created this revision.
rnkovacs added a project: clang-tools-extra.
Herald added subscribers: baloghadamsoftware, JDevlieghere, mgorny.
Finds integer divisions in environments expecting floating-point values.
Examples of possibly unintended precision loss:
sin(7 / (2 + 3));
abs(sin(1 + 7 / 2));
The following expressions are presumably deliberate:
sin(abs(1 + 7 / 2));
1 << 2 / 3;
https://reviews.llvm.org/D35932
Files:
clang-tidy/bugprone/BugproneTidyModule.cpp
clang-tidy/bugprone/CMakeLists.txt
clang-tidy/bugprone/IntegerDivisionCheck.cpp
clang-tidy/bugprone/IntegerDivisionCheck.h
docs/ReleaseNotes.rst
docs/clang-tidy/checks/bugprone-integer-division.rst
docs/clang-tidy/checks/list.rst
test/clang-tidy/bugprone-integer-division.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35932.108424.patch
Type: text/x-patch
Size: 11129 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170727/7a8ff52f/attachment-0001.bin>
More information about the cfe-commits
mailing list