diff options
author | Lei Yang <Lei.Yang@windriver.com> | 2017-11-05 18:56:40 +0800 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2017-11-15 08:07:53 -0700 |
commit | 7d33d2b5b8581ed9f7b2ad93156cde223df718dc (patch) | |
tree | 0c1ee46fb2beff30de2913524c5475a449c3423b /tools/testing | |
parent | 42534b1f58e04a5a6d245d4a8d25f7eb5fd79c7a (diff) |
selftests: memfd_test.c: fix compilation warning.
Replace '%d' by '%zu' to fix the following compilation warning.
memfd_test.c:517:3: warning: format ‘%d’ expects argument of
type ‘int’,but argument 2 has type ‘size_t’ [-Wformat=]
printf("malloc(%d) failed: %m\n", mfd_def_size * 8);
^
memfd_test.c: In function ‘mfd_fail_grow_write’:
memfd_test.c:537:3: warning: format ‘%d’ expects argument
of type ‘int’,but argument 2 has type ‘size_t’ [-Wformat=]
printf("malloc(%d) failed: %m\n", mfd_def_size * 8);
Signed-off-by: Lei Yang <Lei.Yang@windriver.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/memfd/memfd_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c index 845e5f67b6f0..132a54f74e88 100644 --- a/tools/testing/selftests/memfd/memfd_test.c +++ b/tools/testing/selftests/memfd/memfd_test.c @@ -515,7 +515,7 @@ static void mfd_assert_grow_write(int fd) buf = malloc(mfd_def_size * 8); if (!buf) { - printf("malloc(%d) failed: %m\n", mfd_def_size * 8); + printf("malloc(%zu) failed: %m\n", mfd_def_size * 8); abort(); } @@ -535,7 +535,7 @@ static void mfd_fail_grow_write(int fd) buf = malloc(mfd_def_size * 8); if (!buf) { - printf("malloc(%d) failed: %m\n", mfd_def_size * 8); + printf("malloc(%zu) failed: %m\n", mfd_def_size * 8); abort(); } |