-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
When including the utf.h directly or indirectly in my code, I get this error message - at least when compiling the code with Clang 20.
.../MicrosoftCompoundFileReader/include/compoundfilereader/utf.h:52:12: error: 'static' function 'CodePointToUTF8' declared in header file should be declared 'static inline' [-Werror,-Wunneeded-internal-declaration]
52 | static int CodePointToUTF8(uint32_t cp, uint32_t* c1, uint32_t* c2, uint32_t* c3, uint32_t* c4)
| ^~~~~~~~~~~~~~~
1 error generated.
The function is comparably small, so changing static to static inline as suggested by clang, would be an option.
But I am wondering, if declaring the function simple as inline would be sufficient. Then the compiler/linker can decide if it is inlined or a single instance of the function is linked. (Contrary to static inline, which would result in one function for each compilation unit, which includes the function.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels