문제

What flag(s) do I need on the command line to disable the return-value optimisation automatically enabled by the g++ compiler?

도움이 되었습니까?

해결책

-fno-elide-constructors

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]


라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top