From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id AA1BE213B5 for ; Thu, 18 Jul 2024 19:44:17 +0200 (CEST) Received: (qmail 25871 invoked by uid 550); 18 Jul 2024 17:44:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 25836 invoked from network); 18 Jul 2024 17:44:11 -0000 Date: Thu, 18 Jul 2024 17:35:25 +0000 (UTC) From: Thorsten Glaser X-X-Sender: tg@herc.mirbsd.org To: musl@lists.openwall.com In-Reply-To: <20240718173129.GP10433@brightrain.aerifal.cx> Message-ID: References: <10dead9f-55f9-4426-adcb-1d25769e6fc0@brad-house.com> <20240718131949.GQ3766212@port70.net> <0c1ddb63-8bb9-4bfc-918d-3fa4f55fcfa4@brad-house.com> <20240718162541.GO10433@brightrain.aerifal.cx> <20240718173129.GP10433@brightrain.aerifal.cx> Content-Language: de-Zsym-DE-1901-u-em-text-rg-denw-tz-utc, en-Zsym-GB-u-cu-eur-em-text-fw-mon-hc-h23-ms-metric-mu-celsius-rg-denw-tz-utc-va-posix MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Subject: Re: [musl] [PATCH 1/1] FD_SET() and FD_ISSET() warn on -Wsign-conversion 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)=09((s)->fds_bits[(0U + (d)) / (8 * sizeof(long))] |=3D = \ =09=09=09 (1UL << ((0U + (d)) % (8 * sizeof(long))))) Maybe this? bye, //mirabilos --=20 Solange man keine schmutzigen Tricks macht, und ich meine *wirklich* schmutzige Tricks, wie bei einer doppelt verketteten Liste beide Pointer XORen und in nur einem Word speichern, funktioniert Boehm ganz hervorragend.=09=09-- Andreas Bogk =C3=BCber boehm-gc in d.a.s.r