[PATCH v2 0/5] kbuild: uapi: also test UAPI headers against C++ compilers

Thomas Weißschuh posted 5 patches 3 weeks ago
usr/dummy-include/stddef.h |  5 +++++
usr/include/Makefile       | 47 ++++++++++++++++++++++++++++++++++++++--------
2 files changed, 44 insertions(+), 8 deletions(-)
[PATCH v2 0/5] kbuild: uapi: also test UAPI headers against C++ compilers
Posted by Thomas Weißschuh 3 weeks ago
C++ language requirements differ from those of C.

Also test the headers against C++ compilers to make sure no errors
creep in accidentally.

There was a previous attempt by David Howells[0], but today with the
existing UAPI testing infrastructure the implementation is a bit nicer.
This series does not derive from David's, as I found it only after
writing my patches.

[0] https://lore.kernel.org/lkml/nycvar.YFH.7.76.1809052120510.24932@n3.vanv.qr/

This depends on my other series "kbuild: uapi: remove usage of toolchain
headers", which is currently in kbuild-next-unstable.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Changes in v2:
- Rebase on kbuild-next.
- Pick up tags.
- Use $(CLANG_FLAGS) in cc-can-compile-cxx.
- Link to v1: https://patch.msgid.link/20260308-kbuild-uapi-c-v1-0-86aae09a7f1d@weissschuh.net

---
Thomas Weißschuh (5):
      kbuild: uapi: move some compiler arguments out of the command definition
      kbuild: uapi: move all include path flags together
      kbuild: uapi: handle UML in architecture-specific exclusion lists
      kbuild: uapi: provide a C++ compatible dummy definition of NULL
      kbuild: uapi: also test UAPI headers against C++ compilers

 usr/dummy-include/stddef.h |  5 +++++
 usr/include/Makefile       | 47 ++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 44 insertions(+), 8 deletions(-)
---
base-commit: 0d3fccf68d9873a3c824fb70be0dbb2c4642aa90
change-id: 20260223-kbuild-uapi-c-18002c9d7ca3

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>

Re: [PATCH v2 0/5] kbuild: uapi: also test UAPI headers against C++ compilers
Posted by Nicolas Schier 1 week, 5 days ago
On Mon, 16 Mar 2026 17:51:57 +0100, Thomas Weißschuh wrote:
> C++ language requirements differ from those of C.
> 
> Also test the headers against C++ compilers to make sure no errors
> creep in accidentally.
> 
> There was a previous attempt by David Howells[0], but today with the
> existing UAPI testing infrastructure the implementation is a bit nicer.
> This series does not derive from David's, as I found it only after
> writing my patches.
> 
> [...]

Applied to kbuild/linux.git (kbuild-next-unstable), thanks!

[1/5] kbuild: uapi: move some compiler arguments out of the command definition
      https://git.kernel.org/kbuild/c/55d68ec5
[2/5] kbuild: uapi: move all include path flags together
      https://git.kernel.org/kbuild/c/cf822413
[3/5] kbuild: uapi: handle UML in architecture-specific exclusion lists
      https://git.kernel.org/kbuild/c/b4ec38cb
[4/5] kbuild: uapi: provide a C++ compatible dummy definition of NULL
      https://git.kernel.org/kbuild/c/b187c1a1
[5/5] kbuild: uapi: also test UAPI headers against C++ compilers
      https://git.kernel.org/kbuild/c/dcc99abe

Please look out for regression or issue reports or other follow up
comments, as they may result in the patch/series getting dropped,
reverted or modified (e.g. trailers). Patches applied to the
kbuild-next-unstable branch are accepted pending wider testing in
linux-next and any post-commit review; they will generally be moved
to the kbuild-next branch in about a week if no issues are found.

Best regards,
-- 
Nicolas