Skip to content

Commit 051f222

Browse files
Amer-shanawanyshuahkh
authored andcommitted
selftests: filesystems: add missing stddef header
fix compiler warning and errors when compiling statmount test. gcc 12.3 (Ubuntu 12.3.0-1ubuntu1~22.04) statmount_test.c:572:24: warning: implicit declaration of function ‘offsetof’ [-Wimplicit-function-declaration] 572 | #define str_off(memb) (offsetof(struct statmount, memb) / sizeof(uint32_t)) | ^~~~~~~~ statmount_test.c:598:51: note: in expansion of macro ‘str_off’ 598 | test_statmount_string(STATMOUNT_MNT_ROOT, str_off(mnt_root), "mount root"); | ^~~~~~~ statmount_test.c:18:1: note: ‘offsetof’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’? 17 | #include "../../kselftest.h" +++ |+#include <stddef.h> Signed-off-by: Amer Al Shanawany <[email protected]> Reviewed-by: Muhammad Usama Anjum <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 1790947 commit 051f222

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/filesystems/statmount/statmount_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define _GNU_SOURCE
44

55
#include <assert.h>
6+
#include <stddef.h>
67
#include <stdint.h>
78
#include <sched.h>
89
#include <fcntl.h>

0 commit comments

Comments
 (0)