From 39cd902bc09daa7136901dd503b8a6c59620e948 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 9 Jan 2022 17:13:30 +0100 Subject: [PATCH] [string] Added [[nodiscard]] attribute to init_string --- src/util/string.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/string.h b/src/util/string.h index d3965f592..76f2f403f 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -183,10 +183,10 @@ struct string { * @post done_string(@a string) is safe, even if this returned NULL. * @relates string */ #ifdef DEBUG_MEMLEAK -struct string *init_string__(const char *file, int line, struct string *string); +[[nodiscard]] struct string *init_string__(const char *file, int line, struct string *string); #define init_string(string) init_string__(__FILE__, __LINE__, string) #else -struct string *init_string(struct string *string); +[[nodiscard]] struct string *init_string(struct string *string); #endif /** Resets @a string and free()s the string.source member.