swrap: Fix type punning warnings when loading functions.
authorAndreas Schneider <asn@samba.org>
Thu, 2 Oct 2014 05:22:59 +0000 (07:22 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 2 Oct 2014 07:35:10 +0000 (09:35 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/socket_wrapper/socket_wrapper.c

index 430904d..88183c1 100644 (file)
@@ -520,8 +520,9 @@ static void *_swrap_load_lib_function(enum swrap_lib lib, const char *fn_name)
 
 #define swrap_load_lib_function(lib, fn_name) \
        if (swrap.fns.libc_##fn_name == NULL) { \
+               void *swrap_cast_ptr = _swrap_load_lib_function(lib, #fn_name); \
                *(void **) (&swrap.fns.libc_##fn_name) = \
-                       _swrap_load_lib_function(lib, #fn_name); \
+                       swrap_cast_ptr; \
        }