Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 3 Aug 2020 07:43:43 +0200
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Subject: Re: Musl's FD_{SET,ISSET,CLR} macros from sys/select.h
 trigger gcc's -Wsign-conversion warnings

On Sun, Aug 02, 2020 at 09:43:56PM +0200, Petr Skocik wrote:
> A direct size_t cast of (d) could potentially do some type-unsafe things (like convert a pointer),

Then just add 0ul? Pointers stay pointers, and ints become unsigned
longs. Only signed long longs remain signed, but using 0ull would turn
this into 64-bit calculations on 32-bit systems, typically requiring
libgcc calls. Also, storing FDs in long longs is a tad overkill, and
probably not the normal case.

Ciao,
Markus

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.