在看/usr/include/........中.h头文件对函数接口的定义时,总是能看到在函数结尾加一个_THROW,一时不明白这是什么意思,而且对于有些POSIX和ISO C不承认或未明确的定义的函数不加_THROW,注释中也会特别说明,该函数不会抛THROW,所以查了一下,

这是一个宏定义,是在GNU下的特色。在头文件#include <cdefs.h>中定义:

# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
# define __THROW __attribute__ ((__nothrow__))
# define __NTH(fct) __attribute__ ((__nothrow__)) fct
# else
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
# define __NTH(fct) fct throw ()
# else
# define __THROW
# define __NTH(fct) fct
# endif
# endif

在C语言下为 __attribute__ ((__nothrow__))而__nothrow__表示该函数不会抛出异常,但是在C++中就会定义为throw(),和C++异常有关。

最新文章

  1. 案例1.通过Jquery来处理复选框
  2. iOS 利用JSPatch 添加热补丁功能
  3. 创建版本库-GIT
  4. EL和JSTL专题
  5. DIY操作系统(一)
  6. 使用SQL如何把用逗号等字符隔开的字符串转换成列表(转)
  7. linux命令:tail
  8. 那些教程没有的php1-基础知识补漏
  9. HDU 2846 Repository(字典树,标记)
  10. SpriteKitCommonUse
  11. Http Statis 500 -错误笔记
  12. css3 2D变换 transform
  13. loadrunner破解方法--lm70.dll,mlr5lprg.dll下载地址
  14. APPLE-SA-2019-3-27-1 watchOS 5.2
  15. Python多进程并发(multiprocessing)
  16. javaEE中config.properties文件乱码解决办法
  17. C# 使用事务transaction
  18. ABAP-IDOC配置
  19. Puppet file资源使用
  20. 设置Redis最大占用内存

热门文章

  1. 关于Integer的parseInt(String s, int radix)方法的使用
  2. [Python Cookbook] Numpy: Iterating Over Arrays
  3. SecureCRT分屏显示
  4. Atom打开大文件卡死的问题替代方案
  5. RequireJS解决代码依赖问题,异步加载js,避免页面失去相应
  6. EasyMvc入门教程-基本控件说明(10)图片轮播导航
  7. C++面试试题汇总1
  8. 2016.10.18kubernetes 的8080和6443端口的区别与联系
  9. AAuto如何设置定时器
  10. ios 之 autoresizing小解