c – 禁用g的返回值优化

在命令行上需要什么标志来禁用g编译器自动启用的返回值优化?
-fno-elide-构造函数

The C++ standard allows an implementation to omit creating a temporary which is only used to initialize another object of the same type. Specifying this option disables that optimization, and forces G++ to call the copy constructor in all cases. [Source: man gcc]


http://stackoverflow.com/questions/8758152/disabling-gs-return-value-optimisation

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:c – 禁用g的返回值优化