[clang-tools-extra] [clang-tidy] Add bugprone-setvbuf-stack-buffer check (PR #187637)

Zeyi Xu via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 21 01:15:56 PDT 2026


================
@@ -0,0 +1,27 @@
+.. title:: clang-tidy - bugprone-setvbuf-stack-buffer
+
+bugprone-setvbuf-stack-buffer
+=============================
+
+Warns when ``setvbuf()`` is called with a stack-allocated buffer.
+
+The C standard (C11 ยง7.21.5.6) requires that the buffer passed to ``setvbuf()``
----------------
zeyi2 wrote:

Can we make this a link to the standard (or at least a link to open-std or cppreference).

https://github.com/llvm/llvm-project/pull/187637


More information about the cfe-commits mailing list