[clang] [Clang][Docs] Documented sentinel attribute (PR #196088)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 22 08:00:03 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
----------------
erichkeane wrote:
Holy crap this is a terrible design... Indexed from the LAST parameter is... special.
https://github.com/llvm/llvm-project/pull/196088
More information about the cfe-commits
mailing list