1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[string] Added [[nodiscard]] attribute to init_string

This commit is contained in:
Witold Filipczyk 2022-01-09 17:13:30 +01:00
parent 5aa115f08a
commit 39cd902bc0

View File

@ -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.