c/language/attributes/nodiscard

If a function declared or a function returning a struct/union/enum declared  by value is called from a discarded-value expression other than a cast to, the compiler is encouraged to issue a warning.

Explanation
Appears in a function declaration, enumeration declaration, or struct/union declaration.

If, from a discarded-value expression other than a cast to ,


 * a function declared is called, or
 * a function returning a struct/union/enum declared is called,

the compiler is encouraged to issue a warning.

The, if specified, is usually included in the warnings.