Linux filesystem development
 help / color / mirror / Atom feed
From: Nikolai Dokutovich <ndokutovich@gmail.com>
To: Shuah Khan <shuah@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>,
	linux-kselftest@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH 2/2] selftests/coredump: include <stddef.h> for offsetof
Date: Sat, 21 Nov 2026 22:13:40 +0300	[thread overview]
Message-ID: <20261121191340.91952-2-ndokutovich@gmail.com> (raw)
In-Reply-To: <20261121191340.91952-1-ndokutovich@gmail.com>

Both files use offsetof() without including <stddef.h>.  offsetof() is a
macro; without the header it is not expanded, so its first argument is
parsed as a function argument and the type name fails to compile:

  coredump_test_helpers.c:1309:26:
  error: expected expression before struct

Include <stddef.h> in the two files that use offsetof().

Fixes: c71147f42bff ("selftests/coredump: split out common helpers")
Fixes: c09ea6659e50 ("selftests/coredump: split out coredump socket tests")
Signed-off-by: Nikolai Dokutovich <ndokutovich@gmail.com>
---
 tools/testing/selftests/coredump/coredump_socket_test.c  | 1 +
 tools/testing/selftests/coredump/coredump_test_helpers.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/testing/selftests/coredump/coredump_socket_test.c b/tools/testing/selftests/coredump/coredump_socket_test.c
index ec73bb690bbc..c17f3c88a00b 100644
--- a/tools/testing/selftests/coredump/coredump_socket_test.c
+++ b/tools/testing/selftests/coredump/coredump_socket_test.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 
+#include <stddef.h>
 #include <sys/stat.h>
 #include <sys/epoll.h>
 #include <sys/socket.h>
diff --git a/tools/testing/selftests/coredump/coredump_test_helpers.c b/tools/testing/selftests/coredump/coredump_test_helpers.c
index 072ab8624808..85bf5cdf4c4a 100644
--- a/tools/testing/selftests/coredump/coredump_test_helpers.c
+++ b/tools/testing/selftests/coredump/coredump_test_helpers.c
@@ -15,6 +15,7 @@
 #include <poll.h>
 #include <pthread.h>
 #include <stdbool.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-- 
2.34.1


      reply	other threads:[~2026-11-21 19:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 19:13 [PATCH 1/2] selftests/coredump: drop unused <linux/fs.h> include Nikolai Dokutovich
2026-11-21 19:13 ` Nikolai Dokutovich [this message]

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=20261121191340.91952-2-ndokutovich@gmail.com \
    --to=ndokutovich@gmail.com \
    --cc=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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