mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Arnd Bergmann <arnd@arndb.de>,
	Nathan Chancellor <nathan@kernel.org>,
	 Nicolas Schier <nsc@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	"David Howells" <dhowells@redhat.com>,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH RFC 1/5] kbuild: uapi: move some compiler arguments out of the command definition
Date: Sun, 08 Mar 2026 22:24:01 +0100	[thread overview]
Message-ID: <20260308-kbuild-uapi-c-v1-1-86aae09a7f1d@weissschuh.net> (raw)
In-Reply-To: <20260308-kbuild-uapi-c-v1-0-86aae09a7f1d@weissschuh.net>

Simplify the definition of cmd_hdrtest by moving some of it to a new
variable. This will both enable the upcoming reuse of those flags
and also the extension of cmd_hdrtest.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 usr/include/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/usr/include/Makefile b/usr/include/Makefile
index 845d06b63c2b..0b1c9a4b0477 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -140,11 +140,13 @@ always-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/
 target-libc = $(filter $(uses-libc), $*.h)
 target-can-compile = $(filter-out $(no-header-test), $*.h)
 
+hdrtest-flags = -fsyntax-only -Werror \
+		-nostdinc $(if $(target-libc), -I $(srctree)/usr/dummy-include)
+
 # Include the header twice to detect missing include guard.
 quiet_cmd_hdrtest = HDRTEST $<
       cmd_hdrtest = \
-		$(CC) $(c_flags) -fsyntax-only -Werror -x c /dev/null \
-			-nostdinc $(if $(target-libc), -I $(srctree)/usr/dummy-include) \
+		$(CC) $(c_flags) $(hdrtest-flags) -x c /dev/null \
 			$(if $(target-can-compile), -include $< -include $<); \
 		$(PERL) $(src)/headers_check.pl $(obj) $<; \
 		touch $@

-- 
2.53.0


  reply	other threads:[~2026-03-08 21:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-08 21:24 [PATCH RFC 0/5] kbuild: uapi: also test UAPI headers against C++ compilers Thomas Weißschuh
2026-03-08 21:24 ` Thomas Weißschuh [this message]
2026-03-08 21:24 ` [PATCH RFC 2/5] kbuild: uapi: move all include path flags together Thomas Weißschuh
2026-03-08 21:24 ` [PATCH RFC 3/5] kbuild: uapi: handle UML in architecture-specific exclusion lists Thomas Weißschuh
2026-03-08 21:24 ` [PATCH RFC 4/5] kbuild: uapi: provide a C++ compatible dummy definition of NULL Thomas Weißschuh
2026-03-08 21:24 ` [PATCH RFC 5/5] kbuild: uapi: also test UAPI headers against C++ compilers Thomas Weißschuh
2026-03-12  8:15   ` Nathan Chancellor
2026-03-12  8:16 ` [PATCH RFC 0/5] " Nathan Chancellor

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=20260308-kbuild-uapi-c-v1-1-86aae09a7f1d@weissschuh.net \
    --to=linux@weissschuh.net \
    --cc=arnd@arndb.de \
    --cc=dhowells@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@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

all inboxes | Powered by JetHome®