What does extern inline do?

后端 未结 6 2076
闹比i
闹比i 2020-11-22 12:07

I understand that inline by itself is a suggestion to the compiler, and at its discretion it may or may not inline the function, and it will also produce linkab

6条回答
  •  孤街浪徒
    2020-11-22 12:37

    I believe you misunderstand __FILE__ and __LINE__ based on this statement:

    because it uses the __FILE__ and __LINE__ macros which should resolve for the caller but not this called function

    There are several phases of compilation, and preprocessing is the first. __FILE__ and __LINE__ are replaced during that phase. So by the time the compiler can consider the function for inlining they have already been replaced.

提交回复
热议问题