[clang] [clang][analyzer] Add ReportInC99AndEarlier option to DeprecatedOrUnsafeBuf… (PR #168704)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 26 06:40:41 PST 2025


================
@@ -1785,6 +1768,13 @@ security.insecureAPI.DeprecatedOrUnsafeBufferHandling (C)
    strncpy(buf, "a", 1); // warn
  }
 
+The ``AllowWithoutC11`` option allows reporting warnings for these functions even when not compiling with C11 standard. These functions are deprecated in C11, but may still be problematic in earlier C standards.
+
+To enable this option, use:
+``-analyzer-config security.insecureAPI.DeprecatedOrUnsafeBufferHandling:AllowWithoutC11=true``.
+
+By default, this option is set to *false*.
+
----------------
steakhal wrote:

Either works. It mainly depends if you want to / can keep this PR open.
I'm flexible with this regard.

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


More information about the cfe-commits mailing list