I've learned the difference between inline and extern inline in C99. A function defined inline will never, and a function defined extern inline will always, emit an externally visible function. So if I define a function with inline specified in a header and quote this header in multiple translation units, it will occur an error of "undefined reference" if not all the function uses are actually inlined. However if I replace it by extern inline, it will occur an error of "duplicate symbols".
In Wikipedia it suggests
A convenient way is to define the inline functions in header files and create one .c file per function, containing an extern inline declaration for it and including the respective header file with the definition. It does not matter whether the declaration is before or after the include.
It's absolutely a good idea. But my question is why we still need extern inline in this case, instead of declaring without qualifiers? For example.
// func.h
inline void func() {}
// func.c
#include "func.h"
void func(); // Is it really necessary to use extern inline func()?
From my understanding. Since the .c file which contains the declaration corresponds to a single translation unit. The specifier of func's declaration has nothing to do with the inlining in other translation units. So do we really need extern inline in this case? If not, is there any where we must use extern inline?