In C, if I mark a function as inline, and the compiler decides to inline the call, do all function calls from that function also become inlined?
- 11) Definitely not guaranteed, as inline doesn't even guarantee the one you marked as inline is inlined - it is the compiler's callim so confused– im so confused2013-07-02 16:29:36 +00:00Commented Jul 2, 2013 at 16:29
- 1@AK4749 The OP seems to understand that, given he wrote "and the compiler decides to inline the call"...Reed Copsey– Reed Copsey2013-07-02 16:30:25 +00:00Commented Jul 2, 2013 at 16:30
- @ReedCopsey yep, just saw that - it's why your answer is most appropriate. However, from knowing that, he should then know that an implicit inline is not possible - the compiler will make the judgement call in every caseim so confused– im so confused2013-07-02 16:31:29 +00:00Commented Jul 2, 2013 at 16:31
Add a comment |
1 Answer
In C, if I mark a function as inline, and the compiler decides to inline the call, do all function calls from that function also become inlined?
Not necessarily. Inlining a function just inlines that function body (if the compiler "agrees" to do so) - the called functions may be inlined themselves, but may not be, depending on their definition, etc.