public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Shuah Khan <shuah@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v3 13/14] tools/nolibc: add __nolibc_static_assert()
Date: Mon, 22 Dec 2025 09:47:37 +0100	[thread overview]
Message-ID: <aUkFqYpKAiiC33iU@1wt.eu> (raw)
In-Reply-To: <20251220-nolibc-uapi-types-v3-13-c662992f75d7@weissschuh.net>

Hi Thomas,

On Sat, Dec 20, 2025 at 02:55:57PM +0100, Thomas Weißschuh wrote:
> Add a wrapper for _Static_assert() to use within nolibc.
> While _Static_assert() itself was only standardized in C11,
> in GCC and clang dialects it is also available in older standards.
> 
> Link: https://lore.kernel.org/lkml/20251203192330.GA12995@1wt.eu/
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
>  tools/include/nolibc/compiler.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tools/include/nolibc/compiler.h b/tools/include/nolibc/compiler.h
> index c9ffd0496dae..a8c7619dcdde 100644
> --- a/tools/include/nolibc/compiler.h
> +++ b/tools/include/nolibc/compiler.h
> @@ -63,4 +63,12 @@
>  #  define __nolibc_clang_version 0
>  #endif /* __clang__ */
>  
> +#if __STDC_VERSION__ >= 201112L || \
> +	__nolibc_gnuc_version >= __nolibc_version(4, 6, 0) || \
> +	__nolibc_clang_version >= __nolibc_version(3, 0, 0)
> +#  define __nolibc_static_assert(_t) _Static_assert(_t, "")
> +#else
> +#  define __nolibc_static_assert(_t)
> +#endif
> +

Yeah, that's clean this way, I like it!

Acked-by: Willy Tarreau <w@1wt.eu>

  reply	other threads:[~2025-12-22  8:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-20 13:55 [PATCH v3 00/14] tools/nolibc: always use 64-bit time-related types Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 01/14] tools/nolibc/poll: use kernel types for system call invocations Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 02/14] tools/nolibc/poll: drop __NR_poll fallback Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 03/14] tools/nolibc/select: drop non-pselect based implementations Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 04/14] tools/nolibc/time: drop invocation of gettimeofday system call Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 05/14] tools/nolibc: prefer explicit 64-bit time-related system calls Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 06/14] tools/nolibc/gettimeofday: avoid libgcc 64-bit divisions Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 07/14] tools/nolibc/select: avoid libgcc 64-bit multiplications Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 08/14] tools/nolibc: use custom structs timespec and timeval Thomas Weißschuh
2025-12-22  9:38   ` Arnd Bergmann
2025-12-20 13:55 ` [PATCH v3 09/14] tools/nolibc: always use 64-bit time types Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 10/14] selftests/nolibc: test compatibility of nolibc and kernel " Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 11/14] tools/nolibc: remove time conversions Thomas Weißschuh
2025-12-20 13:55 ` [PATCH v3 12/14] tools/nolibc: add compiler version detection macros Thomas Weißschuh
2025-12-22  8:48   ` Willy Tarreau
2025-12-20 13:55 ` [PATCH v3 13/14] tools/nolibc: add __nolibc_static_assert() Thomas Weißschuh
2025-12-22  8:47   ` Willy Tarreau [this message]
2025-12-20 13:55 ` [PATCH v3 14/14] selftests/nolibc: add static assertions around time types handling Thomas Weißschuh
2025-12-22  9:39 ` [PATCH v3 00/14] tools/nolibc: always use 64-bit time-related types Arnd Bergmann

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=aUkFqYpKAiiC33iU@1wt.eu \
    --to=w@1wt.eu \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --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