C++学习(四零五)编译选项use-cxa-atexit no-use-cxa-atexit

本文探讨了C++编译时使用'--use-cxa-atexit'和'--no-use-cxa-atexit'选项的影响。这两个选项与静态对象的析构函数注册有关,涉及C++标准合规性和C库的支持。'use-cxa-atexit'是标准要求,确保静态析构函数正确处理,但依赖于C库的__cxa_atexit支持。
摘要由CSDN通过智能技术生成

GCC docs中,

-fuse-cxa-atexit

Register destructors for objects with static storage duration with the __cxa_atexit function rather than the atexit function. This option is required for fully standards-compliant handling of static destructors, but only works if your C library supports __cxa_atexit.

在clang的参考手册Clang command line argument reference — Clang 13 documentation中,

Override the default ABI to return small structs in registers

-fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit

Use atexit or __cxa_atexit to register global destructors

-fuse-cxa-atexit, -fno-use-cxa-atexit

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值