【来源】
来自 include/linux/compiler-gcc4.h
#define __must_check __attribute__((warn_unused_result))
【作用】
修饰函数,表明调用函数一定要处理被该属性修饰的函数的返回值,否则编译器会给出警告。
【用法】
来自 include/linux/compiler-gcc4.h
extern int __must_check kobject_add(struct kobject *kobj,
struct kobject *parent,
const char *fmt, ...)
__attribute__((format(printf, 3, 4)));
调用 kobject_add 函数的函数,一定要处理 kobject_add 的返回值。