Hi Richard,

On Thu, Oct 16, 2025 at 11:02:04AM +0200, Richard Biener wrote:
> On Wed, Oct 15, 2025 at 6:11 PM Michael Matz <[email protected]> wrote:
[...]
> > > But within the boolean class of integers, it makes no sense to use a
> > > generic operator to get the limits, as there's only one type: bool.
> > > Thus, you just hardcode true and false.
> >
> > I can envision different bool types (of different sizes for instance),
> > where everything is naturally defined.  Maxof/Minof would then return the
> > correctly typed variants of true and false.  But even that imagination
> > isn't necessary to see that Maxof/Minof should "obviously" be defined for
> > bool.
> 
> If we ever expose vector bools as GNU extension then you get a new
> "signed bool" with different _Minof/_Maxof (-1 and 0).
> 
> typedef bool sbool __attribute__((signed_bool_precision(1)));
> 
> _Minof (sbool) == 1
> 
> need to compile with -fgimple to have the attribute not ignored.  And yes,
> a 8-bit precision signed bool is a thing then (but still [-1,0]).

What should _Widthof() return for such types?  1?  8?
<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3573.txt>


Have a lovely day!
Alex

> 
> Richard.

-- 
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).

Attachment: signature.asc
Description: PGP signature

Reply via email to