![]() |
|
Message-ID: <CAHs-p=j-itEb6FVQHY0TSiiRGAwznjm+bEBnFeO8_R1TUQHNaA@mail.gmail.com> Date: Fri, 6 Jun 2025 01:23:14 +0100 From: Andy Caldwell <andy.m.caldwell@...glemail.com> To: musl@...ts.openwall.com Cc: Rich Felker <dalias@...c.org>, David Steele <david@...ackrest.org>, noloader@...il.com Subject: Re: Sign conversion warning in FD_ISSET() > > There probably is some way to get it right with clever use of the > > ternary operator but I haven't come up with anything in the first few > > seconds thinking about it. > > > > Rich Yes, the ternary operator can be used to create a C89-compatible version (this allows anything coercible to an `int` or an `unsigned`, so it mostly only refuses pointers and structures). #define SOCKET_TO_UNSIGNED(s) ((unsigned)(1?(s):0)) Andy
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.