aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2022-05-19 13:33:43 -0500
committerEli Schwartz <eschwartz93@gmail.com>2022-05-19 15:05:53 -0400
commit8d918e01475cfa616e610c5721b5e9198d03f883 (patch)
tree46b22c9a685c9f7b094f1ebbb3bad2edcb04e2a3
parent5d438b6aedbb074c06f6f9fa2f7972b422ccd1bd (diff)
downloadmeson-8d918e01475cfa616e610c5721b5e9198d03f883.zip
meson-8d918e01475cfa616e610c5721b5e9198d03f883.tar.gz
meson-8d918e01475cfa616e610c5721b5e9198d03f883.tar.bz2
Add cc.has_function_attribute('sentinel')
-rw-r--r--docs/markdown/Reference-tables.md1
-rw-r--r--mesonbuild/compilers/c_function_attributes.py2
-rw-r--r--test cases/common/197 function attributes/meson.build1
3 files changed, 4 insertions, 0 deletions
diff --git a/docs/markdown/Reference-tables.md b/docs/markdown/Reference-tables.md
index 8b05d49..60303da 100644
--- a/docs/markdown/Reference-tables.md
+++ b/docs/markdown/Reference-tables.md
@@ -247,6 +247,7 @@ which are supported by GCC, Clang, and other compilers.
| retain⁓ |
| returns_nonnull |
| section⁵ |
+| sentinel⁵ |
| unused |
| used |
| visibility* |
diff --git a/mesonbuild/compilers/c_function_attributes.py b/mesonbuild/compilers/c_function_attributes.py
index faa6570..f663bfc 100644
--- a/mesonbuild/compilers/c_function_attributes.py
+++ b/mesonbuild/compilers/c_function_attributes.py
@@ -94,6 +94,8 @@ C_FUNC_ATTRIBUTES = {
#else
extern int foo __attribute__((section(".bar")));
#endif''',
+ 'sentinel':
+ 'int foo(const char *bar, ...) __attribute__((sentinel));',
'unused':
'int foo(void) __attribute__((unused));',
'used':
diff --git a/test cases/common/197 function attributes/meson.build b/test cases/common/197 function attributes/meson.build
index 4b48cef..4d43ecd 100644
--- a/test cases/common/197 function attributes/meson.build
+++ b/test cases/common/197 function attributes/meson.build
@@ -50,6 +50,7 @@ attributes = [
'nothrow',
'pure',
'section',
+ 'sentinel',
'unused',
'used',
'warn_unused_result',