From patchwork Sun Mar 15 20:32:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 131763 X-Patchwork-Delegate: dj@redhat.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 605DE4BBCDAF for ; Sun, 15 Mar 2026 20:34:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 605DE4BBCDAF Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.a=rsa-sha256 header.s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C header.b=OgfCbWSq X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.cs.ucla.edu (mail.cs.ucla.edu [131.179.128.66]) by sourceware.org (Postfix) with ESMTPS id 94E724B1A36F for ; Sun, 15 Mar 2026 20:33:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 94E724B1A36F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 94E724B1A36F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=131.179.128.66 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773606789; cv=none; b=iWvMaLoGvk/rta3WuJsm+7yyATKgXHK40BFr5D/T70o8h8CynDrh2WnRFrBqt+5IqlZxcadkUz15yAg1dHYYpt8S8w9I7+5vbXNIdmNHvfUaWVw5rt6lQ8gm970vemy/yHGdhmK6K4LOdHHMxyQegOPIGr8k92/wwe9DKgXiyAU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773606789; c=relaxed/simple; bh=XefYJp1HNvsgR7hzO07U1DB6GtAfjvvCmgnh38CHeZs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gqz69WdrcIgOo/pmo/MSMHVMxZePG0nJaOreXAuj3zn3gfAeakuoZYsjUSFBUX/zePYTDhp3M+0EYEtBisxjQNKwozXE2PEangpgqu0RssLzJZc3ovMHAKbjoKUpJtNWg/oTWLStygh1pU3Apzy/42gLomBZ2cUzUBISSA9WbxY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94E724B1A36F Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id ED1633C005380; Sun, 15 Mar 2026 13:33:08 -0700 (PDT) Authentication-Results: mail.cs.ucla.edu (amavis); dkim=pass (2048-bit key) header.d=cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id KHvQHg4enAfd; Sun, 15 Mar 2026 13:33:08 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id C8DDD3C01EBB7; Sun, 15 Mar 2026 13:33:08 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu C8DDD3C01EBB7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1773606788; bh=pSCik008DZAXQnvBFZyDzt4DD9H5xrR8qkf/KJ0ANJ8=; h=From:To:Date:Message-ID:MIME-Version; b=OgfCbWSqAIbxo7aoTEObpdEblUksxROvSTeMvnWoD6/ZnZ6p+jsk+yM/cnVGYpAgM zE3sTd5fEZT3F1WDbgGWgzpVi9tq+dz17q/V2LxQGbiFPm8xk+iHciTBMJ6OL7vnJ/ TK9bRSrRdJFrHn5PlgPYKJXFfzefKQMFQyexjR+VRVRLxZp0IgwJSvF/QX9LdHa9iB SEDjL7aRLQ6UXNmI1o5ZjHhhgy2LiDb2vDOCaDYYdNdjOhueIyshqj+rZsdEGfkrdi S9oLLm/80jXstkgmSW67p92uhk6Q9BcYQaD5joVFoPcjnIiB1zOs0yE0sahlqf0WYQ LTv9n9erZYuEQ== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id iMRCJ0-fLv06; Sun, 15 Mar 2026 13:33:08 -0700 (PDT) Received: from wing.home (47-143-214-216.fdr01.snmn.ca.ip.frontiernet.net [47.143.214.216]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id B020A3C005380; Sun, 15 Mar 2026 13:33:08 -0700 (PDT) From: Paul Eggert To: libc-alpha@sourceware.org Cc: Paul Eggert Subject: [PATCH 2/2] doc: document C23 changes to intmax_t Date: Sun, 15 Mar 2026 13:32:41 -0700 Message-ID: <20260315203255.123865-3-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260315203255.123865-1-eggert@cs.ucla.edu> References: <20260315203255.123865-1-eggert@cs.ucla.edu> MIME-Version: 1.0 X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_EDU_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org * manual/arith.texi (Integers): Say that intmax_t/uintmax_t might be narrower than some integer types. Use wording of C23. Also mention __int128, and that ABI changes if intmax_t changes. Reviewed-by: DJ Delorie --- manual/arith.texi | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/manual/arith.texi b/manual/arith.texi index df6d25e0ba..9f442e4bdd 100644 --- a/manual/arith.texi +++ b/manual/arith.texi @@ -96,16 +96,28 @@ one of these: @item uint_fast64_t @end itemize -If you want an integer with the widest range possible on the platform on -which it is being used, use one of the following. If you use these, -you should write code that takes into account the variable size and range -of the integer. +If you want an integer with a wide range, use one of these: @itemize @bullet @item intmax_t @item uintmax_t @end itemize +@noindent +The @code{intmax_t} type is wide enough to hold any signed integer value, +with the possible exceptions of signed bit-precise integer types, +and of @code{int@var{N}_t} types that are wider than @code{long long int}. +Compilers may also support other integer types wider than +@code{intmax_t}, such as GCC's @code{__int128}. +The @code{uintmax_t} type is like @code{intmax_t}, +except for unsigned integers. + +Code that uses @code{intmax_t} or @code{uintmax_t} should take into +account the variable size, range and alignment of the types. +For example, it is unwise for a public interface to rely on @code{intmax_t}, +as the interface's ABI can change if a different compiler +defines @code{intmax_t} differently. + @Theglibc{} also provides macros that tell you the maximum and minimum possible values for each integer data type. The macro names follow these examples: @code{INT32_MAX}, @code{UINT8_MAX},