Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Amer Al Shanawany <amer.shanawany@gmail.com>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>,
	Shuah Khan <shuah@kernel.org>,
	Christian Brauner <brauner@kernel.org>,
	Miklos Szeredi <mszeredi@redhat.com>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Subject: [PATCH v2] selftests: filesystems: add missing stddef header
Date: Mon, 22 Apr 2024 15:16:59 +0200	[thread overview]
Message-ID: <20240422131659.30222-1-amer.shanawany@gmail.com> (raw)
In-Reply-To: <df1df586-188e-4290-9986-7b7cd31710e3@collabora.com>

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 <amer.shanawany@gmail.com>
---
V1 -> V2 added compiler warning in the patch message

 tools/testing/selftests/filesystems/statmount/statmount_test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/filesystems/statmount/statmount_test.c b/tools/testing/selftests/filesystems/statmount/statmount_test.c
index 3eafd7da58e2..e6d7c4f1c85b 100644
--- a/tools/testing/selftests/filesystems/statmount/statmount_test.c
+++ b/tools/testing/selftests/filesystems/statmount/statmount_test.c
@@ -3,6 +3,7 @@
 #define _GNU_SOURCE
 
 #include <assert.h>
+#include <stddef.h>
 #include <stdint.h>
 #include <sched.h>
 #include <fcntl.h>
-- 
2.34.1


  reply	other threads:[~2024-04-22 13:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 16:16 [PATCH] selftests: filesystems: add missing stddef header Amer Al Shanawany
2024-04-19 16:45 ` Muhammad Usama Anjum
2024-04-20 15:56   ` Amer Al Shanawany
2024-04-22  5:17     ` Muhammad Usama Anjum
2024-04-22 13:16       ` Amer Al Shanawany [this message]
2024-04-22 13:49         ` [PATCH v2] " Muhammad Usama Anjum
2024-05-04 17:20           ` Amer Al Shanawany

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240422131659.30222-1-amer.shanawany@gmail.com \
    --to=amer.shanawany@gmail.com \
    --cc=brauner@kernel.org \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=shuah@kernel.org \
    --cc=usama.anjum@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox