Make rk_SOCK_INIT an inline function and check the result to avoid warnings
commitbf3c4219fe01c50edbc19361592b6846d132e306
authorAndrew Bartlett <abartlet@samba.org>
Thu, 28 May 2020 08:09:43 +0000 (28 20:09 +1200)
committerJeffrey Altman <jaltman@auristor.com>
Thu, 28 May 2020 15:10:57 +0000 (28 11:10 -0400)
tree2c22ac43804b8c8b6c37ac2d4e2470702552c5da
parent9ffbc17a0f9921717ea55c59532ed74d22758217
Make rk_SOCK_INIT an inline function and check the result to avoid warnings

Similar to f6e0d19cc036bc3601c2b8a8d9c064adbace9737 but
fixed in the header by making it a proper static inline
function (as some callers treats it as one, so do it
for all now for consistency).

Seen on Ubuntu 18.04 with

giving:

In file included from getaddrinfo-test.c:36:0:
getaddrinfo-test.c: In function ‘main’:
roken.h:110:24: error: statement with no effect [-Werror=unused-value]
 #define rk_SOCK_INIT() 0
                        ^
getaddrinfo-test.c:132:5: note: in expansion of macro ‘rk_SOCK_INIT’
     rk_SOCK_INIT();
     ^~~~~~~~~~~~

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
lib/roken/getaddrinfo-test.c
lib/roken/roken.h.in
lib/roken/test-mini_inetd.c