On 17/07/2023 18:04, Paul Eggert wrote:
On 2023-07-17 03:31, Pádraig Brady wrote:
static inline void

As a general rule, there's no need for 'static inline' in C, as nowadays
compilers figure out inlining just fine for static functions and plain
'static' should be good enough. There are exceptions but 'write_error'
doesn't look like it's one of them.

Right. In headers though, the traditional "static inline" idiom
indicates to the compiler that this function is a small
utility function that may not be used in all translation units
that the header is included in.  I.e. without the inline,
in some translation units you'd get:

  error: 'write_error' defined but not used [-Werror=unused-function]

cheers,
Pádraig.



Reply via email to