Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHs-p=gcX83iGOzbwCU+cUW1Lif5+mEU2M0rHnYQNVCkEwge+w@mail.gmail.com>
Date: Fri, 6 Jun 2025 20:33:45 +0100
From: Andy Caldwell <andy.m.caldwell@...glemail.com>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com, David Steele <david@...ackrest.org>, noloader@...il.com
Subject: Re: Sign conversion warning in FD_ISSET()

On Fri, Jun 6, 2025 at 5:08 PM Rich Felker <dalias@...c.org> wrote:
>
> On Fri, Jun 06, 2025 at 05:01:29PM +0100, Andy Caldwell wrote:
> > > Something like ((unsigned)(1?1*(s):0)) ?
> > >
> > > Rich
> >
> > Even simpler - ((unsigned)(1*(s)))
>
> Even simpler: ((unsigned)+(s))

That reminded me of the type-annotations from asm.js which lead me to
((unsigned)((s)|0)) which has the advantage of refusing float/double
arguments (as well as pointer/struct types).  The other asm.js
annotation that's useable in C is `+<val>` as in your example (allows
int-like and float-like types).

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.