[clang-tools-extra] [clang-tidy] Add bugprone-setvbuf-stack-buffer check (PR #187637)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 20 05:51:45 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE LINT COMMENT: clang-tidy-->
:warning: C/C++ code linter, clang-tidy found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
```bash
git diff -U0 origin/main...HEAD -- clang-tools-extra/clang-tidy/bugprone/SetvbufStackBufferCheck.cpp clang-tools-extra/clang-tidy/bugprone/SetvbufStackBufferCheck.h clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp |
python3 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -path build -p1 -quiet
```
</details>
<details>
<summary>
View the output from clang-tidy here.
</summary>
```
clang-tools-extra/clang-tidy/bugprone/SetvbufStackBufferCheck.cpp:37:55: warning: statement should have braces [readability-inconsistent-ifelse-braces]
37 | if (const auto *DRE = dyn_cast<DeclRefExpr>(BufArg))
| ^
| {
38 | VD = dyn_cast<VarDecl>(DRE->getDecl());
39 | else if (const auto *UO = dyn_cast<UnaryOperator>(BufArg)) {
| }
```
</details>
https://github.com/llvm/llvm-project/pull/187637
More information about the cfe-commits
mailing list