• Zhangjin Wu's avatar
    selftests/nolibc: stat_fault: silence NULL argument warning with glibc · 46cf630c
    Zhangjin Wu authored
    Use another invalid address (void *)1 instead of NULL to silence this
    compile warning with glibc:
    
        $ make libc-test
          CC      libc-test
        nolibc-test.c: In function ‘run_syscall’:
        nolibc-test.c:622:49: warning: null argument where non-null required (argument 1) [-Wnonnull]
          622 |   CASE_TEST(stat_fault);        EXPECT_SYSER(1, stat(NULL, &stat_buf), -1, EFAULT); break;
              |                                                 ^~~~
        nolibc-test.c:304:79: note: in definition of macro ‘EXPECT_SYSER2’
          304 |  do { if (!cond) pad_spc(llen, 64, "[SKIPPED]\n"); else ret += expect_syserr2(expr, expret, experr1, experr2, llen); } while (0)
              |                                                                               ^~~~
        nolibc-test.c:622:33: note: in expansion of macro ‘EXPECT_SYSER’
          622 |   CASE_TEST(stat_fault);        EXPECT_SYSER(1, stat(NULL, &stat_buf), -1, EFAULT); break;
    Reviewed-by: default avatarThomas Weißschuh <linux@weissschuh.net>
    Signed-off-by: default avatarZhangjin Wu <falcon@tinylab.org>
    Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
    46cf630c
nolibc-test.c 37.1 KB