public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: libc-alpha@sourceware.org, eggert@cs.ucla.edu
Subject: Re: [PATCH 2/2] doc: document C23 changes to intmax_t
Date: Tue, 17 Mar 2026 21:47:58 -0400	[thread overview]
Message-ID: <xna4w5aoxd.fsf@greed.delorie.com> (raw)
In-Reply-To: <20260315203255.123865-3-eggert@cs.ucla.edu> (message from Paul Eggert on Sun, 15 Mar 2026 13:32:41 -0700)

Paul Eggert <eggert@cs.ucla.edu> writes:
> -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:

Perhaps "with the widest range of any standard type," ?

>  @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},

Otherwise LGTM
Reviewed-by: DJ Delorie <dj@redhat.com>


  reply	other threads:[~2026-03-18  1:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-15 20:32 [PATCH 0/2] document improvements for max_align_t, intmax_t Paul Eggert
2026-03-15 20:32 ` [PATCH 1/2] doc: document max_align_t effect on ABI Paul Eggert
2026-03-18  1:44   ` DJ Delorie
2026-03-15 20:32 ` [PATCH 2/2] doc: document C23 changes to intmax_t Paul Eggert
2026-03-18  1:47   ` DJ Delorie [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-02-26 18:41 [PATCH v3 4/4] malloc: alignment might change in future versions Paul Eggert
2026-02-26 18:38 ` [PATCH 1/2] doc: document max_align_t effect on ABI Paul Eggert
2026-02-26 18:38   ` [PATCH 2/2] doc: document C23 changes to intmax_t Paul Eggert

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=xna4w5aoxd.fsf@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=eggert@cs.ucla.edu \
    --cc=libc-alpha@sourceware.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).