【发布时间】:2010-03-07 00:00:30
【问题描述】:
在 64 位 Linux 机器上编译后,我收到内联警告。编译器是:
gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1
警告是:
warning: inlining failed : call is unlikely and code size would grow
warning: called from here
warning: inlining failed: call is unlikely and code size would grow
warning: called from here
warning: inlining failed: call is unlikely and code size would grow
warning: called from here
warning: inlining failed: call is unlikely and code size would grow
我搜索了它并使用 -Winline 选项编译它。但还没有找到解决办法。我正在寻找摆脱它的方法。如何摆脱它?
slightly edited on 9th May 2010
我已经发布了我很久以前就面临的上述问题。我仍在寻找解决方案。我尝试从函数中删除所有 inline 。这导致不使用代码中定义的许多函数,例如:
warning: function defined but not used
我认为删除 inline_ 甚至降低了代码的性能(速度)。有人可以为上述问题提出一些想法吗?
有没有什么优化方法可以不降低性能,也可以去掉这个警告。
【问题讨论】:
标签: gcc inline compiler-warnings