khatchad
khatchad

Reputation: 3176

Does marking a function as inline in C cause all called functions to be implicitly marked as inlined?

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?

Upvotes: 4

Views: 132

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564901

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.

Upvotes: 5

Related Questions