public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	Alex Colomar <alx.manpages@gmail.com>,
	libc-alpha@sourceware.org, JeanHeyd Meneide <wg14@soasis.org>
Subject: Re: [PATCH] inttypes.h: imaxabs(3): Implement as a macro
Date: Tue, 13 Sep 2022 15:59:58 -0500	[thread overview]
Message-ID: <63b5b82e-f7c5-92c7-6efa-e36c55f45c14@cs.ucla.edu> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2209131929230.3092943@digraph.polyomino.org.uk>

[-- Attachment #1: Type: text/plain, Size: 330 bytes --]

On 9/13/22 14:30, Joseph Myers wrote:
> Standard C doesn't discuss off_t at all.  Maybe whatever version of POSIX
> gets based on C2x should address that question.

That would be a good idea. However, the glibc manual should discuss this 
regardless of whether POSIX addresses it. For now, how about the 
attached proposed patch?

[-- Attachment #2: 0001-Document-ISO-C23-s-types-wider-than-intmax_t.patch --]
[-- Type: text/x-patch, Size: 1998 bytes --]

From 4acf0090cf31cbde99bb64d8024f5f4bc90a6296 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 13 Sep 2022 15:56:38 -0500
Subject: [PATCH] =?UTF-8?q?Document=20ISO=20C23=E2=80=99s=20types=20wider?=
 =?UTF-8?q?=20than=20intmax=5Ft?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 manual/arith.texi | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/manual/arith.texi b/manual/arith.texi
index edb9cfdafb..83f3e7607b 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -96,7 +96,8 @@ one of these:
 @item uint_fast64_t
 @end itemize
 
-If you want an integer with the widest range possible on the platform on
+If you want an integer that ordinarily has 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.
@@ -106,6 +107,18 @@ of the integer.
 @item uintmax_t
 @end itemize
 
+Draft @w{ISO C23} allows for signed integer types wider than @code{intmax_t}.
+These include signed bit-precise integer types and extended integer
+types that are wider than @code{long long} and that are referred by the
+type definition for an exact width integer type.  For example, if
+@code{intmax_t} is equivalent to @code{long long} and is 64 bits,
+the signed bit-precise integer type @code{_BitInt (128)} and the
+typedef @code{int128_t}, if they exist, are wider than @code{intmax_t}.
+However, @theglibc{} avoids wider-than-@code{intmax_t} types
+and it is safe to convert to @code{intmax_t} any signed integer value
+documented as being generated or used by @theglibc{}, and similarly
+for @code{uintmax_t} and unsigned integer values.
+
 @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},
-- 
2.37.2


  reply	other threads:[~2022-09-13 21:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 15:18 Alex Colomar
2022-09-13 15:28 ` Alejandro Colomar
2022-09-13 15:34 ` Alejandro Colomar
2022-09-13 18:27 ` Joseph Myers
2022-09-13 18:47   ` Paul Eggert
2022-09-13 19:30     ` Joseph Myers
2022-09-13 20:59       ` Paul Eggert [this message]
2022-09-13 22:43   ` Alejandro Colomar
2022-09-13 22:56     ` Joseph Myers
2022-09-13 23:43       ` Alejandro Colomar
2022-09-14 16:41         ` Joseph Myers
2022-09-14 19:03           ` JeanHeyd Meneide
2022-09-15 12:33             ` Alejandro (Alex) Colomar

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=63b5b82e-f7c5-92c7-6efa-e36c55f45c14@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=alx.manpages@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=wg14@soasis.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).