diff options
author | David Robillard <d@drobilla.net> | 2024-06-22 20:12:50 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-06-22 20:19:27 -0400 |
commit | 384b073bdad676bd3e1e39b527321e9a67bfa491 (patch) | |
tree | e56722ca117ecdab51b61b69d69c0fd5fdb158e3 /include/zix/attributes.h | |
parent | b7e4e28dccdff26bc5e402926e61039f8e9ee966 (diff) | |
download | zix-384b073bdad676bd3e1e39b527321e9a67bfa491.tar.gz zix-384b073bdad676bd3e1e39b527321e9a67bfa491.tar.bz2 zix-384b073bdad676bd3e1e39b527321e9a67bfa491.zip |
Add ZIX_NODISCARD attribute to allocating, accessor, and pure API
Diffstat (limited to 'include/zix/attributes.h')
-rw-r--r-- | include/zix/attributes.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/zix/attributes.h b/include/zix/attributes.h index a0ed276..249e6a6 100644 --- a/include/zix/attributes.h +++ b/include/zix/attributes.h @@ -50,17 +50,20 @@ /// A pure function in the public API that only reads memory #define ZIX_PURE_API \ ZIX_API \ - ZIX_PURE_FUNC + ZIX_PURE_FUNC \ + ZIX_NODISCARD /// A const function in the public API that is pure and only reads parameters #define ZIX_CONST_API \ ZIX_API \ - ZIX_CONST_FUNC + ZIX_CONST_FUNC \ + ZIX_NODISCARD /// A malloc function in the public API that returns allocated memory #define ZIX_MALLOC_API \ ZIX_API \ - ZIX_MALLOC_FUNC + ZIX_MALLOC_FUNC \ + ZIX_NODISCARD // Printf-like format functions #ifdef __GNUC__ |