是否有一个gcc选项来承担所有extern" C"功能不能传播异常? [英] Is there a gcc option to assume all extern "C" functions cannot propagate exceptions?

查看:142
本文介绍了是否有一个gcc选项来承担所有extern" C"功能不能传播异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法,总之把一个属性上的每个函数原型,让GCC知道C函数不能传播的例外,即这里面的externC __ __属性((抛出异常))?理想的情况是一个 -f 风格的命令行选项。

Is there any way, short of putting an attribute on each function prototype, to let gcc know that C functions can never propagate exceptions, i.e. that all functions declared inside extern "C" should be __attribute__((nothrow))? Ideal would be a -f style command line option.

推荐答案

您可以随时使用 -fno-例外这将确保C ++编译器不产生异常传播code。

You can always use -fno-exceptions which will ensure that the c++ compiler does not generate exception propagation code.

这篇关于是否有一个gcc选项来承担所有extern" C"功能不能传播异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆