开发者

Getting the inlining failed warning during gcc compilation

What is the reason for the following kind of warning

     inlining failed to while calling the function: The code size may grow.

when function is static inline.Following is a kind of function defined in header file. How can i get rid of the above mentioned warn开发者_高级运维ing.

        static __inline___ getSomething(){
        return something;
        }

EDIT

yes i tried removing the inline, but i get the following warning

     function getSomething defined but not used.

Is there any way to remove both the warnings?

[EDIT]

  -g -Wno-unused  -g -ansi -pedantic -Wall -Wshadow -Wpointer-arith -Wwrite-strings


Remove the __inline__ keyword. Compilers are generally smart enough to know when to inline, and unless you're doing detailed profiling and know better, trying to force it is unnecessary.


Is the function really not used? may be it should be removed altogether?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜