toolchain: Add macro for warning for unused return values

This will let us get compiler warnings whenever the return value of
specific functions stays unused. I called this __must_check since that's
the name Linux uses as well.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2021-06-15 13:22:36 +03:00 committed by Carles Cufí
commit 49987e8eca

View file

@ -194,6 +194,9 @@ do { \
#ifndef __attribute_const__
#define __attribute_const__ __attribute__((__const__))
#endif
#ifndef __must_check
#define __must_check __attribute__((warn_unused_result))
#endif
#define ARG_UNUSED(x) (void)(x)
#define likely(x) __builtin_expect((bool)!!(x), true)