Skip to contentSkip to conversation

ring_buffer.h: fix GCC warning about unused function

PATCH In review Lev Stipakov 2 participants 2 messages Nov 24, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ring_buffer.h: fix GCC warning about unused function

From: Lev Stipakov <[email protected]...>

With register_ring_buffers() being declared as "static" in header file, all translation units, which include that header, got a copy of that function. This causes GCC warning

warning: "register_ring_buffers" defined but not used [-Wunused-function]

when compiling C files which include header, but don't use function.

Add "inline" keyword to silence this warning.

---
 src/openvpn/ring_buffer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ring_buffer.h +1 -1
index 77579e3f..9661ceb3 100644
@@ -94,7 +94,7 @@ struct TUN_PACKET
  *                            that data has been written to receive ring
  * @return                    true if registration is successful, false otherwise - use GetLastError()
  */
-static bool
+static inline bool
 register_ring_buffers(HANDLE device,
                       struct tun_ring *send_ring,
                       struct tun_ring *receive_ring,
Signature · 1 line
2.23.0.windows.1
Acked-by on v1 1/1
#1 lore raw

Thanks. (Found while looking at the compiler warnings reviewing the OpenSSL config loading patch). Test built on MinGW, warnings gone.

Your patch has been applied to the master branch.

commit 71371f04afa6eba3ea02a67590a70e018cf203e5 (master) commit 36b3129d47a6dbfcd43ff4773c69618a28eb48bc (release/2.5)

Author: Lev Stipakov
Date:   Wed Nov 24 18:03:47 2021 +0200
     ring_buffer.h: fix GCC warning about unused function

     Signed-off-by: Lev Stipakov <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg23260.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering