]> granicus.if.org Git - p11-kit/commitdiff
Fix compiler warnings on FreeBSD
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sat, 21 Jan 2017 17:49:42 +0000 (21:49 +0400)
committerDaiki Ueno <ueno@gnu.org>
Mon, 23 Jan 2017 08:35:19 +0000 (09:35 +0100)
 * common/compat.c: Fix "implicit declaration of function 'issetugid'"
   warning. On FreeBSD, it's required to define __BSD_VISIBLE to make
   issetugid(2) visible
 * common/test-message.c: Fix "implicit declaration of function
   'asprintf'" by including <stdio.h>
 * p11-kit/test-iter.c: Fix "format '%lu' expects argument of
   type 'long unsigned int', but argument 3 has type 'int'" by
   changing format string to "%d"

common/compat.c
common/test-message.c
p11-kit/test-iter.c

index 627411e40036974aceb0aa2aeeb5dba6351ac470..1255b0e991ff2ced471e48c46fa79841b669306d 100644 (file)
  */
 #define _XOPEN_SOURCE 700
 
+#if defined(HAVE_ISSETUGID) && defined(__FreeBSD__)
+#define __BSD_VISIBLE 1
+#endif
+
 #include "compat.h"
 #include "debug.h"
 
index 63ecf3148dd68fdb14c7e18c2818bf0f3205046f..7dd5426fa8be855614f959e60deb6b81845b7927 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <errno.h>
 #include <stdlib.h>
+#include <stdio.h>
 
 static void
 test_with_err (void)
index 3f5a76f67b796ede0b0b39146449645936fd471b..4ce480a37c4eb98f9153b5d51277dd65540e5ad5 100644 (file)
@@ -780,7 +780,7 @@ test_slot_match_by_id (void)
        modules = initialize_and_get_modules ();
 
        uri = p11_kit_uri_new ();
-       ret = asprintf (&string, "pkcs11:slot-id=%lu", MOCK_SLOT_ONE_ID);
+       ret = asprintf (&string, "pkcs11:slot-id=%d", MOCK_SLOT_ONE_ID);
        assert (ret > 0);
        ret = p11_kit_uri_parse (string, P11_KIT_URI_FOR_SLOT, uri);
        free (string);