2
我刚刚读取Qt4源代码,发现预编译器在qstring.h(和其他位置)中多次定义了Q_REQUIRED_RESULT
。Q_REQUIRED_RESULT做什么?
它实际上做了什么为什么它没有记录(适合here)?
它的定义如下:
#ifndef Q_REQUIRED_RESULT
# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result))
# else
# define Q_REQUIRED_RESULT
# endif
#endif