From: Peter Seiderer <ps.report@gmx.net>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Shuah Khan <shuah@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
linux-kselftest@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH 1/2] selftests/pid_namespace: fix building with clang-20
Date: Tue, 18 Mar 2025 16:08:52 +0100 [thread overview]
Message-ID: <20250318160852.2bc4ed52@gmx.net> (raw)
In-Reply-To: <20250311160706.75319-1-dmantipov@yandex.ru>
Hello Dmitry,
On Tue, 11 Mar 2025 19:07:05 +0300, Dmitry Antipov <dmantipov@yandex.ru> wrote:
> When using 'make LLVM=1 W=1 -C tools/testing/selftests/pid_namespace'
> with clang-20, I've noticed the following:
>
> pid_max.c:42:8: error: call to undeclared function 'mount'; ISO
> C99 and later do not support implicit function declarations
> [-Wimplicit-function-declaration]
> 42 | ret = mount("", "/", NULL, MS_PRIVATE | MS_REC, 0);
> | ^
> pid_max.c:42:29: error: use of undeclared identifier 'MS_PRIVATE'
> 42 | ret = mount("", "/", NULL, MS_PRIVATE | MS_REC, 0);
> | ^
> ...
>
> So include '<sys/mount.h>' to add all of the required declarations.
>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> ---
> tools/testing/selftests/pid_namespace/pid_max.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/pid_namespace/pid_max.c b/tools/testing/selftests/pid_namespace/pid_max.c
> index 51c414faabb0..972bedc475f1 100644
> --- a/tools/testing/selftests/pid_namespace/pid_max.c
> +++ b/tools/testing/selftests/pid_namespace/pid_max.c
> @@ -11,6 +11,7 @@
> #include <string.h>
> #include <syscall.h>
> #include <sys/wait.h>
> +#include <sys/mount.h>
>
> #include "../kselftest_harness.h"
> #include "../pidfd/pidfd.h"
Predated patches already available, see
https://lore.kernel.org/linux-kselftest/20250115105211.390370-1-ps.report@gmx.net/
https://lore.kernel.org/linux-kselftest/20250115105211.390370-2-ps.report@gmx.net/
https://lore.kernel.org/linux-kselftest/20250115105211.390370-3-ps.report@gmx.net/
Regards,
Peter
prev parent reply other threads:[~2025-03-18 15:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 16:07 [PATCH 1/2] selftests/pid_namespace: fix building with clang-20 Dmitry Antipov
2025-03-11 16:07 ` [PATCH 2/2] selftests/pidfd: " Dmitry Antipov
2025-03-18 15:08 ` Peter Seiderer [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=20250318160852.2bc4ed52@gmx.net \
--to=ps.report@gmx.net \
--cc=dmantipov@yandex.ru \
--cc=justinstitt@google.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--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