内联警告

时间:2010-03-07 00:00:30

标签: gcc inline compiler-warnings

在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

我已经发布了上述问题,这是我很久以前面临的问题。我仍然在寻找解决方案。我尝试从函数中删除所有内联。这导致不使用代码中定义的许多函数,如:

warning: function  defined but not used

我认为删除内联_ 甚至会降低代码的性能(速度)。请问有人可以就上述问题提出一些建议吗?

是否有任何优化方法,以便不会降低性能,也可以删除此警告。

1 个答案:

答案 0 :(得分:1)

编译器认为内联这些函数是个坏主意。

内联关键字只是一个建议,编译器不必遵循它。据推测,编译器警告您它决定忽略内联关键字。