Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 31 May 2023 10:29:59 -0400
From: Rich Felker <dalias@...c.org>
To: Jens Gustedt <Jens.Gustedt@...ia.fr>
Cc: musl@...ts.openwall.com
Subject: Re: [C23 128 bit 4/4] C23: implement proper support for
 int128_t and uint128_t

On Wed, May 31, 2023 at 10:27:44AM -0400, Rich Felker wrote:
> On Wed, May 31, 2023 at 04:15:50PM +0200, Jens Gustedt wrote:
> > By implementing support for w128 length specifiers for printf and
> > scanf, the only final bit that we need to be able to support these
> > types officially as extended integer type and map them to the
> > fixed-width types are the integer literals. In C23, the new types
> > `_IntBit(N)` and their literals are mandatory. Most commonly they will
> > support N >= 128. The maximum value for N can be queried with
> > `BITINT_MAXWIDTH`. If we have such literals, use them to construct the
> > constants for `[U]INT128_C` and provide the rest of the macros for
> > these types.
> 
> Unless the rules in C23 changed, I don't think yoou can define uintN_t
> where N is larger than width of intmax_t; these can only be accessible
> as _BitInt types not intN_t. (This was the whole reason _BitInt was
> added, no?)

And, as I'm reading it, this also means printf and scanf do not need
to support w128. 7.23.6.1 ΒΆ7:

    "All minimum-width integer types (7.22.1.2) and exact-width
    integer types (7.22.1.1) de- fined in the header <stdint.h> shall
    be supported. Other supported values of N are
    implementation-defined."

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.