在 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

本文探讨了C++编译时使用'--use-cxa-atexit'和'--no-use-cxa-atexit'选项的影响。这两个选项与静态对象的析构函数注册有关,涉及C++标准合规性和C库的支持。'use-cxa-atexit'是标准要求,确保静态析构函数正确处理,但依赖于C库的__cxa_atexit支持。
最低0.47元/天 解锁文章
1651

被折叠的 条评论
为什么被折叠?



