diff options
Diffstat (limited to 'include/zix/attributes.h')
-rw-r--r-- | include/zix/attributes.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/zix/attributes.h b/include/zix/attributes.h index eddb80e..a0ed276 100644 --- a/include/zix/attributes.h +++ b/include/zix/attributes.h @@ -38,11 +38,13 @@ # define ZIX_PURE_FUNC __attribute__((pure)) # define ZIX_CONST_FUNC __attribute__((const)) # define ZIX_MALLOC_FUNC __attribute__((malloc)) +# define ZIX_NODISCARD __attribute__((warn_unused_result)) #else # define ZIX_ALWAYS_INLINE_FUNC ///< Should absolutely always be inlined # define ZIX_PURE_FUNC ///< Only reads memory # define ZIX_CONST_FUNC ///< Only reads its parameters # define ZIX_MALLOC_FUNC ///< Allocates memory with no pointers in it +# define ZIX_NODISCARD ///< Returns a value that must be used #endif /// A pure function in the public API that only reads memory |