Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3a1e3c19-a150-4400-ae80-8a4f56a951dd@brad-house.com>
Date: Thu, 1 Aug 2024 15:06:24 -0400
From: Brad House <brad@...d-house.com>
To: musl@...ts.openwall.com, Thorsten Glaser <tg@...bsd.de>
Subject: Re: [PATCH 1/1] FD_SET() and FD_ISSET() warn on
 -Wsign-conversion

On 7/18/24 1:35 PM, Thorsten Glaser wrote:

> Rich Felker dixit:
>
>> Use of signed ints generates worse code (not just bitshift/mask, needs
>> fixup for C's wrong definition of signed integer division) and has
>> more-dangerous behavior in the event of a negative input (small
>> negative offset likely to clobber data in an exploitable way rather
>> than giant positive offset likely to crash).
> Aieee. I see, more reasons against signed integers in C :/
>
> #define FD_SET(d,s)	((s)->fds_bits[(0U + (d)) / (8 * sizeof(long))] |= \
> 			    (1UL << ((0U + (d)) % (8 * sizeof(long)))))
>
Sorry it took me a while to reply on this.  But no, this doesn't resolve 
the issue, it still emits the same warning.

-Brad


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.