From nobody Thu Jan 1 22:21:37 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dj1Wk5JfVz6Lpmp for ; Thu, 01 Jan 2026 22:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dj1Wk174Kz49dg for ; Thu, 01 Jan 2026 22:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767306098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7XgAIVxJvZWpcEQK0230b0DtvqbvcdiSG6yU9oNUBMI=; b=RNhCRwQpVvP6PRkekrv/KKsORdh8XMqsUtftjj604WSNzfNkRnxygSH6TI6wDe+Jjkw2Me mmzOUj1zXEymS3lpuK13Whe+l6iK9wfpxdEnWcX+FwS17D0+/0V/f20SPdxklOK93nnVa6 PNx2fTJ+ZS0nj84Oo0kC6OSLOlNQ8B6r3E690ZwyGV1LOjC+kV/Ezra0UAhdFxvaWt1/ed 3h6pjJLTHELlx1uYZM5mFsN6P5w7BAOPI3XjTXi6jY/0uNeLdTzir9xp6s1QmxWdP7cwDS ixAB0/MRw9co4nklBnraoDScogE/ZMMa+uvGR9F/zJxMSPme1D6FgrbBYEXFTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767306098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7XgAIVxJvZWpcEQK0230b0DtvqbvcdiSG6yU9oNUBMI=; b=S6LL8CTNyO6JH4mXhVS9PBwt0a1MtPf4OCPlOhy4BLf0Zaza6rwI1cTWaR+oMUJ1w7JvpG sKyhlADXqTSZN6Ic9TonkX25MhJNMXRRt7NLgj3rbIpDJnnEHQZo9YHho2JE8rC08+Vxh/ K+sY0+KS5dQNTnfz7+1VfJTBYZ3Q7raQe9IAqhglzGo2ydGZDwR+Uv8/QJ5ejcBx2O7jw6 fUI8FMSxv/O4K6vB9AUcTOVr+RWoBYYs8+ZLJO91PUs6b4bOdyw8Qjm10yaAztmMBviJRz UhMavIZPAnzqf7BySae45OQS4tZ2Ny1O2JIRnlALMgYvetmcrVT1KIoMTigw2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1767306098; a=rsa-sha256; cv=none; b=Igxb4HJLJu5onSvZ52gKrd3fcTznDmu78PHHtsMDThob2ZQAb7J81JV0G0atqR+GXRToH5 Gie/MFLX5h72fz2WovGOjbxih5PH4Ajpp9O6RtgJB/8zHI6mWDK2kfbQLTYcjvuZcg6oaB 4Ljl8D4EzWwh9RQvf7LoGwT80le0WnVKHU1PGNhMPp1k5MxLmrCLYUUeOqM3Q83/qKoiTV hvTzp6b7AlLCrvFBsN5XueFAR+KQYGyYkm/IUgjjZIyuyAkPDhDrjgK2M4YK/XjHWSRm5z NYiK3rTLn8FWJ19Vb9F3T6QWia57JA4lyXONXJsYMzFkyn1j6BF8YTtlsEFKYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dj1Wj6LVnzrX8 for ; Thu, 01 Jan 2026 22:21:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id eeea by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 01 Jan 2026 22:21:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Clausecker Subject: git: ff50ace5fe0e - stable/15 - sys/stdint.h: add C23 _WIDTH macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ff50ace5fe0ec991ff2e72a80a6c9e90b7e7f709 Auto-Submitted: auto-generated Date: Thu, 01 Jan 2026 22:21:37 +0000 Message-Id: <6956f371.eeea.3c94c9e9@gitrepo.freebsd.org> The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=ff50ace5fe0ec991ff2e72a80a6c9e90b7e7f709 commit ff50ace5fe0ec991ff2e72a80a6c9e90b7e7f709 Author: Robert Clausecker AuthorDate: 2025-11-19 18:53:07 +0000 Commit: Robert Clausecker CommitDate: 2026-01-01 20:51:52 +0000 sys/stdint.h: add C23 _WIDTH macros The platform-dependent macros are added to the various _stdint.h headers, those that are always the same are added directly to _stdint.h. We may want to move the definitions for WCHAR_* and WINT_* out of the platform header files as those are always the same. Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D53830 (cherry picked from commit 7998a82d2f99a00086baf64b2a3343ba10f8806d) --- sys/arm/include/_stdint.h | 23 +++++++++++++++++++++++ sys/arm64/include/_stdint.h | 23 +++++++++++++++++++++++ sys/powerpc/include/_stdint.h | 33 +++++++++++++++++++++++++++++++++ sys/riscv/include/_stdint.h | 23 +++++++++++++++++++++++ sys/sys/stdint.h | 29 +++++++++++++++++++++++++++++ sys/x86/include/_stdint.h | 33 +++++++++++++++++++++++++++++++++ 6 files changed, 164 insertions(+) diff --git a/sys/arm/include/_stdint.h b/sys/arm/include/_stdint.h index 9931f8b56ef5..2ebc6ea4f89f 100644 --- a/sys/arm/include/_stdint.h +++ b/sys/arm/include/_stdint.h @@ -153,6 +153,29 @@ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX +#if __ISO_C_VISIBLE >= 2023 +/* + * ISO/IEC 9899:2023 + * 7.22.2 Widths of specified-width integer types + */ +#define INT_FAST8_WIDTH INT32_WIDTH +#define INT_FAST16_WIDTH INT32_WIDTH +#define INT_FAST32_WIDTH INT32_WIDTH +#define INT_FAST64_WIDTH INT64_WIDTH +#define INTPTR_WIDTH INT32_WIDTH +#define INTMAX_WIDTH INT64_WIDTH + +/* + * ISO/IEC 9899:2023 + * 7.22.3 Width of other integer types + */ +#define PTRDIFF_WIDTH INT32_WIDTH +#define SIG_ATOMIC_WIDTH INT32_WIDTH +#define SIZE_WIDTH INT32_WIDTH +#define WCHAR_WIDTH INT32_WIDTH +#define WINT_WIDTH INT32_WIDTH +#endif /* __ISO_C_VISIBLE >= 2023 */ + #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ #endif /* !_MACHINE__STDINT_H_ */ diff --git a/sys/arm64/include/_stdint.h b/sys/arm64/include/_stdint.h index 0c183bd60dca..0b360b8ab460 100644 --- a/sys/arm64/include/_stdint.h +++ b/sys/arm64/include/_stdint.h @@ -155,6 +155,29 @@ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX +#if __ISO_C_VISIBLE >= 2023 +/* + * ISO/IEC 9899:2023 + * 7.22.2 Widths of specified-width integer types + */ +#define INT_FAST8_WIDTH INT32_WIDTH +#define INT_FAST16_WIDTH INT32_WIDTH +#define INT_FAST32_WIDTH INT32_WIDTH +#define INT_FAST64_WIDTH INT64_WIDTH +#define INTPTR_WIDTH INT64_WIDTH +#define INTMAX_WIDTH INT64_WIDTH + +/* + * ISO/IEC 9899:2023 + * 7.22.3 Width of other integer types + */ +#define PTRDIFF_WIDTH INT64_WIDTH +#define SIG_ATOMIC_WIDTH INT64_WIDTH +#define SIZE_WIDTH INT64_WIDTH +#define WCHAR_WIDTH INT32_WIDTH +#define WINT_WIDTH INT32_WIDTH +#endif /* __ISO_C_VISIBLE >= 2023 */ + #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ #endif /* !_MACHINE__STDINT_H_ */ diff --git a/sys/powerpc/include/_stdint.h b/sys/powerpc/include/_stdint.h index 67719432259d..983db38ccf25 100644 --- a/sys/powerpc/include/_stdint.h +++ b/sys/powerpc/include/_stdint.h @@ -195,6 +195,39 @@ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX +#if __ISO_C_VISIBLE >= 2023 +/* + * ISO/IEC 9899:2023 + * 7.22.2 Widths of specified-width integer types + */ +#define INT_FAST8_WIDTH INT32_WIDTH +#define INT_FAST16_WIDTH INT32_WIDTH +#define INT_FAST32_WIDTH INT32_WIDTH +#define INT_FAST64_WIDTH INT64_WIDTH +#ifdef __LP64__ +#define INTPTR_WIDTH INT64_WIDTH +#else +#define INTPTR_WIDTH INT32_WIDTH +#endif +#define INTMAX_WIDTH INT64_WIDTH + +/* + * ISO/IEC 9899:2023 + * 7.22.3 Width of other integer types + */ +#ifdef __LP64__ +#define PTRDIFF_WIDTH INT64_WIDTH +#define SIG_ATOMIC_WIDTH INT64_WIDTH +#define SIZE_WIDTH INT64_WIDTH +#else +#define PTRDIFF_WIDTH INT32_WIDTH +#define SIG_ATOMIC_WIDTH INT32_WIDTH +#define SIZE_WIDTH INT32_WIDTH +#endif +#define WCHAR_WIDTH INT32_WIDTH +#define WINT_WIDTH INT32_WIDTH +#endif /* __ISO_C_VISIBLE >= 2023 */ + #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ #endif /* !_MACHINE__STDINT_H_ */ diff --git a/sys/riscv/include/_stdint.h b/sys/riscv/include/_stdint.h index 4e032c8b0a1d..9df000b0eac4 100644 --- a/sys/riscv/include/_stdint.h +++ b/sys/riscv/include/_stdint.h @@ -151,6 +151,29 @@ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX +#if __ISO_C_VISIBLE >= 2023 +/* + * ISO/IEC 9899:2023 + * 7.22.2 Widths of specified-width integer types + */ +#define INT_FAST8_WIDTH INT32_WIDTH +#define INT_FAST16_WIDTH INT32_WIDTH +#define INT_FAST32_WIDTH INT32_WIDTH +#define INT_FAST64_WIDTH INT64_WIDTH +#define INTPTR_WIDTH INT64_WIDTH +#define INTMAX_WIDTH INT64_WIDTH + +/* + * ISO/IEC 9899:2023 + * 7.22.3 Width of other integer types + */ +#define PTRDIFF_WIDTH INT64_WIDTH +#define SIG_ATOMIC_WIDTH INT64_WIDTH +#define SIZE_WIDTH INT64_WIDTH +#define WCHAR_WIDTH INT32_WIDTH +#define WINT_WIDTH INT32_WIDTH +#endif /* __ISO_C_VISIBLE >= 2023 */ + #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ #endif /* !_MACHINE__STDINT_H_ */ diff --git a/sys/sys/stdint.h b/sys/sys/stdint.h index f82e391c9e41..77f469f3c2a3 100644 --- a/sys/sys/stdint.h +++ b/sys/sys/stdint.h @@ -73,4 +73,33 @@ typedef __uint_fast64_t uint_fast64_t; #endif #endif /* __EXT1_VISIBLE */ +#if __ISO_C_VISIBLE >= 2023 +#define INT8_WIDTH 8 +#define UINT8_WIDTH 8 +#define INT_LEAST8_WIDTH 8 +#define UINT_LEAST8_WIDTH 8 +#define UINT_FAST8_WIDTH INT_FAST8_WIDTH + +#define INT16_WIDTH 16 +#define UINT16_WIDTH 16 +#define INT_LEAST16_WIDTH 16 +#define UINT_LEAST16_WIDTH 16 +#define UINT_FAST16_WIDTH INT_FAST16_WIDTH + +#define INT32_WIDTH 32 +#define UINT32_WIDTH 32 +#define INT_LEAST32_WIDTH 32 +#define UINT_LEAST32_WIDTH 32 +#define UINT_FAST32_WIDTH INT_FAST32_WIDTH + +#define INT64_WIDTH 64 +#define UINT64_WIDTH 64 +#define INT_LEAST64_WIDTH 64 +#define UINT_LEAST64_WIDTH 64 +#define UINT_FAST64_WIDTH INT_FAST64_WIDTH + +#define UINTMAX_WIDTH INTMAX_WIDTH +#define UINTPTR_WIDTH INTPTR_WIDTH +#endif /* __ISO_C_VISIBLE >= 2023 */ + #endif /* !_SYS_STDINT_H_ */ diff --git a/sys/x86/include/_stdint.h b/sys/x86/include/_stdint.h index 59aab4b39c0c..1b8523bf656b 100644 --- a/sys/x86/include/_stdint.h +++ b/sys/x86/include/_stdint.h @@ -184,6 +184,39 @@ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX +#if __ISO_C_VISIBLE >= 2023 +/* + * ISO/IEC 9899:2023 + * 7.22.2 Widths of specified-width integer types + */ +#define INT_FAST8_WIDTH INT32_WIDTH +#define INT_FAST16_WIDTH INT32_WIDTH +#define INT_FAST32_WIDTH INT32_WIDTH +#define INT_FAST64_WIDTH INT64_WIDTH +#ifdef __LP64__ +#define INTPTR_WIDTH INT64_WIDTH +#else +#define INTPTR_WIDTH INT32_WIDTH +#endif +#define INTMAX_WIDTH INT64_WIDTH + +/* + * ISO/IEC 9899:2023 + * 7.22.3 Width of other integer types + */ +#ifdef __LP64__ +#define PTRDIFF_WIDTH INT64_WIDTH +#define SIG_ATOMIC_WIDTH INT64_WIDTH +#define SIZE_WIDTH INT64_WIDTH +#else +#define PTRDIFF_WIDTH INT32_WIDTH +#define SIG_ATOMIC_WIDTH INT32_WIDTH +#define SIZE_WIDTH INT32_WIDTH +#endif +#define WCHAR_WIDTH INT32_WIDTH +#define WINT_WIDTH INT32_WIDTH +#endif /* __ISO_C_VISIBLE >= 2023 */ + #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ #endif /* !_MACHINE__STDINT_H_ */