fio: fix detecting libpmem
authorLukasz Dorau <lukasz.dorau@intel.com>
Wed, 27 Jan 2021 07:27:53 +0000 (08:27 +0100)
committerLukasz Dorau <lukasz.dorau@intel.com>
Wed, 27 Jan 2021 10:01:54 +0000 (11:01 +0100)
The current test for libpmem in 'configure' fails
in the following way:

$ gcc test.c -lpmem
test.c: In function ‘main’:
test.c:6:27: warning: passing argument 2 of ‘pmem_is_pmem’ \
             makes integer from pointer \
             without a cast [-Wint-conversion]
    6 |   rc = pmem_is_pmem(NULL, NULL);
      |                           ^~~~
      |                           |
      |                           void *
In file included from test.c:1:
/usr/include/libpmem.h:92:43: note: expected ‘size_t’ \
             {aka ‘long unsigned int’} but argument \
             is of type ‘void *’
   92 | int pmem_is_pmem(const void *addr, size_t len);
      |                                    ~~~~~~~^~~

Fix it.

configure

index e6e33d7f6451054163bcaa9d6acc77bfd802c45a..748f7014c63541b26ef66dd8b72fcd1a8a27f777 100755 (executable)
--- a/configure
+++ b/configure
@@ -2055,7 +2055,7 @@ cat > $TMPC << EOF
 int main(int argc, char **argv)
 {
   int rc;
-  rc = pmem_is_pmem(NULL, NULL);
+  rc = pmem_is_pmem(NULL, 0);
   return 0;
 }
 EOF