[clang] [Clang][Docs] Add documentation for -Wfortify-source (PR #224111)

Nick Desaulniers via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 24 11:56:20 PDT 2026


================
@@ -1897,7 +1897,34 @@ def CrossTURemarks : DiagGroup<"ctu-remarks">;
 
 def CTADMaybeUnsupported : DiagGroup<"ctad-maybe-unsupported">;
 
-def FortifySource : DiagGroup<"fortify-source", [FormatOverflow, FormatTruncation]>;
+def FortifySource : DiagGroup<"fortify-source", [FormatOverflow, FormatTruncation]> {
+  code Documentation = [{
+Warns at compile time when calls to standard C library or POSIX functions have
+provably out-of-bounds destination buffers or invalid constant arguments,
+modeled after `_FORTIFY_SOURCE` compile-time checks.
----------------
nickdesaulniers wrote:

Can we include a link to something that describes what "`_FORTIFY_SOURCE` compile-time checks" are? Otherwise, this last part reads somewhat circular.

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


More information about the cfe-commits mailing list