From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id E71EB3858D39 for ; Tue, 28 Mar 2023 14:53:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E71EB3858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=42241 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1phAhG-00FiQm-Uu; Tue, 28 Mar 2023 14:53:14 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.96) (envelope-from ) id 1phAhG-002aNn-2h; Tue, 28 Mar 2023 16:53:14 +0200 From: Florian Weimer To: Cyril Hrubis Cc: Paul Eggert , Zack Weinberg , GNU libc development Subject: Re: Bad interaction between signal constants and -Wsign-conversion References: <280b4afe-d080-4be5-a296-ec914b0b5439@app.fastmail.com> Date: Tue, 28 Mar 2023 16:53:14 +0200 In-Reply-To: (Cyril Hrubis's message of "Tue, 28 Mar 2023 16:03:46 +0200") Message-ID: <87h6u5udut.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Cyril Hrubis: > Hi! >> > # define SA_RESETHAND ((int)0x80000000) /* Reset to SIG_DFL on entry to handler. */ >> > >> > Anyone got a better idea? >> >> Perhaps this instead: >> >> #define SA_RESETHAND (-1 - 0x7fffffff) > > Why not (1<<31) ? Some compilers warn about it, too. Shifting into the sign position is undefined in the standard. I suggest to write out the negative constants explicitly, as a decimal integer.