r/C_Programming • u/wiseneddustmite • May 31 '26
question about inline
i read that inline tells the compiler to write the code of the function directly where the function is called in the code instead of calling the function that was declared separately and this saves a bit of performance, but when should/shouldn't inline be used
9
Upvotes
View all comments
Show parent comment
1
u/EpochVanquisher Jun 01 '26
I don’t think I can write a short response to this that capture what I want to say. Yeah, there’s tail call optimization, but it changes the backtrace, which impacts your ability to debug. And then there’s the idiomatic way to write functions. Why optimize for programming styles most people don’t use? Whether the compiler does all this will probably be independent of whether your function is inline. So there’s a lot more to the discussion.