Does GCC inline C++ functions without the 'inline' keyword?

前端 未结 4 1034
不知归路
不知归路 2020-12-03 04:45

Does GCC, when compiling C++ code, ever try to optimize for speed by choosing to inline functions that are not marked with the inline keyword?

4条回答
  •  悲哀的现实
    2020-12-03 05:01

    Yes, especially if you have a high level of optimizations enabled.

    There is a flag you can provide to the compiler to disable this: -fno-inline-functions.

提交回复
热议问题