Size: 425
Comment:
|
← Revision 8 as of 2017-12-30 01:30:21 ⇥
Size: 475
Comment: converted to 1.6 markup
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
==What's the difference between extern and static inline ?== | == What's the difference between extern and static inline ? == |
Line 4: | Line 4: |
- ''static inline "means" we have to have this function, if you use it but don't inline it, then make a static version of it in this compilation unit''. | |
Line 5: | Line 7: |
- "static inline" means "we have to have this function, if you use it but don't inline it, then make a static version of it in this compilation unit" |
- ''extern inline "means" I actually _have_ an extern for this function, but if you want to inline it, here's the inline-version''. |
Line 9: | Line 9: |
- "extern inline" means "I actually _have_ an extern for this function, but if you want to inline it, here's the inline-version" |
|
Line 12: | Line 10: |
But also see Inline Functions in C. | But also see [[http://www.greenend.org.uk/rjk/2003/03/inline.html|Inline Functions in C]] |
What's the difference between extern and static inline ?
Let Linus explain :
- static inline "means" we have to have this function, if you use it but don't inline it, then make a static version of it in this compilation unit.
- extern inline "means" I actually _have_ an extern for this function, but if you want to inline it, here's the inline-version.
But also see Inline Functions in C