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