在 2019/4/8 下午7:18, Jacek Caban 写道: > > Sure, but what does it have to do with __forceinline? __forceinline is > for functions that are really meant to be inlined and thus I think it > should not try to preserve single pointer value. With removed extern, we > leave the choice for user, one could still use extern __forceinline. >
There is no guarantee that a `__forceinline` function will be inlined; in case of inline failure a user would get an undefined reference. But in reality, all SSE intrinsic functions provided by GCC are marked `extern __inline __attribute__((__gnu_inline__, __always_inline__))`. So I think the `extern` specifier is unnecessary for 'functions that are really meant to be inlined'. As for our current implementation (`__gnu_inline__` for C) there will be no external definitions, no matter whether the function is inlined or not, and `extern __forceinline` will be exactly the same as `__forceinline`. So what is the use of `extern` there? > > And in this particular context of time functions, we really don't want > to allow compiler/linker using the available symbol. It may be a > different variant of the function than was used by the header. > > Yeah I agree. The `extern` can be removed from `__forceinline` provided that such functions must be inlined. -- Best regards, LH_Mouse
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public