multiple definition of inline function

后端 未结 6 1603
情深已故
情深已故 2020-12-08 19:51

I have gone through some posts related to this topic but was not able to sort out my doubt completely. This might be a very naive question.

I have a header file

6条回答
  •  轮回少年
    2020-12-08 20:54

    basically Inline is a late entry to GCC ( I mean c compiler). "[ . . . ] An inline definition does not provide an external definition for the function, and does not forbid an external definition in another translation unit. An inline definition provides an alternative to an external definition, which a translator may use to implement any call to the function in the same translation unit. It is unspecified whether a call to the function uses the inline definition or the external definition." — ISO 9899:1999(E), the C99 standard, section 6.7.4

提交回复
热议问题