[clang] [Clang][Docs] Documented sentinel attribute (PR #196088)

Tony Guillot via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 04:59:08 PDT 2026


================
@@ -10055,3 +10055,65 @@ different languages to coexist on the same call stack while each interpreting
 exceptions according to their own rules.
   }];
 }
+
+def SentinelDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+The ``sentinel`` attribute can be applied to variadic functions and pointers to
+variadic functions, to diagnose each function call that does not pass a
+sentinel value (a null pointer constant) as the last argument to the function
+call. The attribute accepts two optional arguments: the first argument is the
+position of the expected sentinel value, starting from the last parameter. The
----------------
to268 wrote:

Aaron and I had the same reaction about that.

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


More information about the cfe-commits mailing list