From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9567 invoked from network); 3 Aug 2020 17:47:23 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 3 Aug 2020 17:47:23 -0000 Received: (qmail 13421 invoked by uid 550); 3 Aug 2020 17:47:20 -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 13403 invoked from network); 3 Aug 2020 17:47:19 -0000 Date: Mon, 3 Aug 2020 13:47:07 -0400 From: Rich Felker To: Markus Wichmann Cc: musl@lists.openwall.com Message-ID: <20200803174707.GF6949@brightrain.aerifal.cx> References: <959b7861-f028-02cc-5226-d7116aab8e2b@gmail.com> <9d46d00c-9a67-30eb-d60e-8bd3b0661178@gmail.com> <20200803054343.GF2076@voyager> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200803054343.GF2076@voyager> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Musl's FD_{SET,ISSET,CLR} macros from sys/select.h trigger gcc's -Wsign-conversion warnings On Mon, Aug 03, 2020 at 07:43:43AM +0200, Markus Wichmann wrote: > 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. That's no different than what the code is already doing, getting the desired promotion via C's promotion rules. Unfortunately compilers are wrongly complaining about it because it doesn't meet their preferred style rules. Rich