diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-04-16 12:34:33 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-04-16 12:35:44 +0200 |
commit | 39b5c6f45e6b84861e5edeaef323ebdf9238eaf0 (patch) | |
tree | f0050802bf7c55c95874b859fc0e8d8f55d04966 /include | |
parent | debc90ba2d7b637d4b78764b148df51963532b7f (diff) |
Annotate some extra functions with nodiscard
Diffstat (limited to 'include')
-rw-r--r-- | include/alloc.h | 6 | ||||
-rw-r--r-- | include/errors.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/alloc.h b/include/alloc.h index 0237334..01863aa 100644 --- a/include/alloc.h +++ b/include/alloc.h @@ -20,8 +20,8 @@ typedef struct { size_t _init; } arena; -[[gnu::returns_nonnull]] void *bufalloc(void *, size_t, size_t); -void *bufalloc_noterm(void *, size_t, size_t); +[[nodiscard, gnu::returns_nonnull]] void *bufalloc(void *, size_t, size_t); +[[nodiscard]] void *bufalloc_noterm(void *, size_t, size_t); [[_mlib_pure, _mlib_inline]] static inline arena @@ -30,7 +30,7 @@ mkarena(size_t n) return (arena){._init = n ? n : MLIB_ARENA_BLKSIZE}; } -[[gnu::malloc, gnu::alloc_size(2, 3), gnu::alloc_align(4)]] +[[nodiscard, gnu::malloc, gnu::alloc_size(2, 3), gnu::alloc_align(4)]] void *arena_alloc(arena *, size_t, size_t, size_t); void arena_zero(arena *); diff --git a/include/errors.h b/include/errors.h index 6e8cbce..961ecf1 100644 --- a/include/errors.h +++ b/include/errors.h @@ -15,7 +15,7 @@ extern const char *_mlib_errors_progname; void mlib_setprogname(const char *); -[[_mlib_inline]] +[[nodiscard, _mlib_inline]] static inline const char * mlib_progname(void) { |