Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1 |
|
#
267ad430 |
| 17-Sep-2024 |
Zoltán Porkoláb <zporky@gmail.com> |
[clang-tidy] Extend `bugprone-sizeof-expression` with matching `P +- sizeof(T)` and `P +- N */ sizeof(T)` cases, add `cert-arr39-c` alias (#106061)
Improved `bugprone-sizeof-expression` check to fin
[clang-tidy] Extend `bugprone-sizeof-expression` with matching `P +- sizeof(T)` and `P +- N */ sizeof(T)` cases, add `cert-arr39-c` alias (#106061)
Improved `bugprone-sizeof-expression` check to find suspicious pointer
arithmetic calculations where the pointer is offset by an `alignof()`,
`offsetof()`, or `sizeof()` expression.
Pointer arithmetic expressions implicitly scale the offset added to or
subtracted from the address by the size of the pointee type. Using an
offset expression that is already scaled by the size of the underlying
type effectively results in a squared offset, which is likely an invalid
pointer that points beyond the end of the intended array.
```c
void printEveryEvenIndexElement(int *Array, size_t N) {
int *P = Array;
while (P <= Array + N * sizeof(int)) { // Suspicious pointer arithmetics using sizeof()!
printf("%d ", *P);
P += 2 * sizeof(int); // Suspicious pointer arithmetics using sizeof()!
}
}
```
---------
Co-authored-by: Whisperity <whisperity@gmail.com>
show more ...
|
Revision tags: llvmorg-19.1.0 |
|
#
7deca859 |
| 16-Sep-2024 |
Congcong Cai <congcongcai0907@163.com> |
[clang-tidy] fix false positive when member initialization depends on structured binging variable in cppcoreguidelines-prefer-member-initializer (#108743)
Fixes: #82970
Detecting dependiences wit
[clang-tidy] fix false positive when member initialization depends on structured binging variable in cppcoreguidelines-prefer-member-initializer (#108743)
Fixes: #82970
Detecting dependiences with `varDecl` is too strict. It will ignore the
`bingingDecl`.
This patch wants to use `valueDecl` to match more cases including
`bingingDecl`.
show more ...
|
Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3 |
|
#
e9cec392 |
| 16-Feb-2024 |
Congcong Cai <congcongcai0907@163.com> |
[clang-tidy] fix incorrect hint for InitListExpr in prefer-member-initializer (#81560)
|
Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init |
|
#
6a80e56a |
| 22-Jan-2024 |
Piotr Zegar <me@piotrzegar.pl> |
[clang-tidy] Fix macros handling in cppcoreguidelines-prefer-member-initializer (#72037)
Produces now valid fixes for a member variables initialized with macros.
Correctly uses expansion location i
[clang-tidy] Fix macros handling in cppcoreguidelines-prefer-member-initializer (#72037)
Produces now valid fixes for a member variables initialized with macros.
Correctly uses expansion location instead of location inside macro to
get init code.
Close #70189
show more ...
|
Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4 |
|
#
26374675 |
| 27-Oct-2023 |
Congcong Cai <congcongcai0907@163.com> |
[clang-tidy]Fix PreferMemberInitializer false positive for reassignment (#70316)
- assignment twice cannot be simplified to once when assigning to
reference type
- safe assignment cannot be advanc
[clang-tidy]Fix PreferMemberInitializer false positive for reassignment (#70316)
- assignment twice cannot be simplified to once when assigning to
reference type
- safe assignment cannot be advanced before unsafe assignment
show more ...
|
Revision tags: llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2 |
|
#
7a4b12e3 |
| 07-Aug-2023 |
Piotr Zegar <me@piotrzegar.pl> |
[clang-tidy] Exclude delegate constructors in cppcoreguidelines-prefer-member-initializer
As proposed by check fix would result in compilation error, lets exclude delegate constructors from being ch
[clang-tidy] Exclude delegate constructors in cppcoreguidelines-prefer-member-initializer
As proposed by check fix would result in compilation error, lets exclude delegate constructors from being checked.
Fixes: #52818
Reviewed By: ccotter
Differential Revision: https://reviews.llvm.org/D157242
show more ...
|
Revision tags: llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6 |
|
#
89a1d03e |
| 17-Jun-2022 |
Richard <legalize@xmission.com> |
[clang-tidy] Organize test files into subdirectories by module (NFC)
Eliminate clutter by reorganizing the Lit test files for clang-tidy: - Move checkers/<module>-* to checkers/<module>/*. - Move mo
[clang-tidy] Organize test files into subdirectories by module (NFC)
Eliminate clutter by reorganizing the Lit test files for clang-tidy: - Move checkers/<module>-* to checkers/<module>/*. - Move module specific inputs from Inputs to <module>/Inputs. Remove any module prefix from the file or subdirectory name as they are no longer needed. - Introduce a Lit substitution %clang_tidy_headers for the system headers in checkers/Inputs/Headers and use this throughout. This avoids referencing system headers through a relative path to the parent directory and makes it clear that these fake system headers are shared among all modules. - Update add_new_check.py to follow the above conventions when creating the boiler plate test files for a new check. - Update Contributing.rst to describe per-module Inputs directory and fix link to test source code.
Differential Revision: https://reviews.llvm.org/D128072
show more ...
|