关于glibc中的函数宣言

关于glibc中的函数声明
本帖最后由 a55569769 于 2012-12-12 23:21:21 编辑
今天看glibc的源代码有很多的函数声明是这种格式的   
extern int semctl (int __semid, int __semnum, int __cmd, ...)  __THROW;


后面加了个  __THROW是啥意思啊,不太懂
------解决方案--------------------

# if defined __cplusplus && (__GNUC__ >;= 3 
------解决方案--------------------
 __GNUC_MINOR__ >;= 
#  define __THROW       throw ()
# else
#  define __THROW
# endif


在c++调用的情况下,会在函数声明后加入 throw()
表明该函数不会扔出异常,这样避免编译器生成对异常的
处理代码,优化生成结果.