[PATCH 04/18] Removed superfluous 'static' keyword from always_inline functions.

Alejandro Colomar alx.manpages at gmail.com
Thu Jun 2 18:04:58 UTC 2022


'static' is completely redundant with
'__attribute__((__always_inline__))'.  Also, it's unnatural (and
wrong) to have 'static' functions that aren't local to a
translation unit.  It is wrong because either it means nothing
(when paired with always_inline) or it produces code bloat (when
it's not paired with always_inline).
---
 src/nxt_clang.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nxt_clang.h b/src/nxt_clang.h
index b8fa08a..c0513f0 100644
--- a/src/nxt_clang.h
+++ b/src/nxt_clang.h
@@ -9,7 +9,7 @@
 
 
 #define nxt_always_inline  __attribute__((__always_inline__))
-#define nxt_inline         nxt_always_inline static inline
+#define nxt_inline         nxt_always_inline inline
 #define nxt_noinline       __attribute__((noinline))
 #define nxt_cdecl
 
-- 
2.36.1



More information about the unit mailing list