Is “inline” without “static” or “extern” ever useful in C99?

Actually this excellent answer also answers your question, I think:

What does extern inline do?

The idea is that “inline” can be used in a header file, and then “extern inline” in a .c file. “extern inline” is just how you instruct the compiler which object file should contain the (externally visible) generated code.

[update, to elaborate]

I do not think there is any use for “inline” (without “static” or “extern”) in a .c file. But in a header file it makes sense, and it requires a corresponding “extern inline” declaration in some .c file to actually generate the stand-alone code.

Leave a Comment