Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vFbK0-00EVba-C1 for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Nov 2025 16:52:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vFbJz-00CQse-0c for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Nov 2025 16:52:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vFbJy-00CQq7-Mh for pgsql-hackers@lists.postgresql.org; Sun, 02 Nov 2025 16:52:49 +0000 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vFbJv-005bHy-0k for pgsql-hackers@lists.postgresql.org; Sun, 02 Nov 2025 16:52:49 +0000 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-7866aca9e25so4925097b3.3 for ; Sun, 02 Nov 2025 08:52:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762102365; x=1762707165; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=23b/uyv6nlFfQXfA0jME/il8PTDmqc9GO9KCdDJ0FoY=; b=U49Xk5zKS8w7Ek4XjFRDRHmZsLqJo9Q8cZEcav3y73vrQ6oymTcH7oenDHY9VvCvgZ YL6EJEUuFyXZe8V+VFdbf3GW0m/EepnzoO04FuE2K5IDGR7ijIawOh5tn8qqic6bN1B9 tGRyhhc9TLB6gXOLuvnUQfklx9KmbDMEWO+PeOXBHMtMCM4XraNePKqTTV0gZ9a7nXcH 11WnJ0O394bPoihdROsUtw96N5OD7gn0jX7woUvK4zT8KcqAJgVC+zzgWMva2qsr34Fz pp5Jt0P+eC2M1LZYR5CilPzQTFyOHUJZ+zOSjqdBn3LHDsg1DD2f+Eed8wrkdkPk1lF4 1uUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762102365; x=1762707165; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=23b/uyv6nlFfQXfA0jME/il8PTDmqc9GO9KCdDJ0FoY=; b=Dq4kFpOjCZLnXU/jLiN5JomKGpJd69bXXVAECMnLlw/Dgod07fo3zZLhy9yoGjb4nw JnLRG2e2YjPzzQehvcs8MAzw7czvGxexYPF4oKJwQVP5Cjy2u4bZ2l1bRj4TLvloiQxA +Rr6TFKk63GyxZtA6GUnzpZEWkUmjhTqxuaVo+SxPFpuxblw8YQLbhGpiSlt8ucl5Fpq L8WFBg3lkWsra1rqzIZkK7MmsYrtmxIzftG5rDtX6RQgw8b2OqbP10vBVBNyH71PC3Y0 IrY9bdQ06CtpaW6g0shFpscQdmVQ0ohAGswSBx160hZslK6x2XZa6KAY8Y00oDdzzNRF IV1A== X-Gm-Message-State: AOJu0YwjKEFs3kgZFLcdrSmmGlcvVpV7KQlSIwAf75hgVAMLVjjtYEK6 mznxgKg4abvLNSuc3kWKXiV5E+3+C8EPasju4uZP2i+q7eNf0c6mv3QBHUrHA730dVoQEBev X-Gm-Gg: ASbGncuRKBjGTFTVXhSH1US5fmMrs6SYgMqVkb7k3lUymcmuIf1z14ZA1dXpufNjU4c rb8gjcHB57sSSscqksKO1wWQD0IvWgbIA55m+CRDXy+nWsukr/0EKL2UI5PlBaXd/EcpAk+YK5g lCSe+gHfIBxYZkm/+amNq9hGpTEHyGU75wqrEZ7A9+v5EEoHI8EWJ1mx6rHGKNFHT7WtCQzpfNL wVhyU9PJFmRY49U1iTOCLphTGb+4Q9XAVzqw5ldukcakGxt44Fv+DrG/HgXm0hQuBYxS682kQba PejNjW/z1opGpoZotTArRwh9z9xzQn4zswtMxRvS493K3dK5JFyFoYFKYau3tLMF7U4o8VURDWQ LozA/+fYLlBDmD4LvX4pJ73iY2J6JcRfaISMsqzvtsxPJmlnT2H1y+c+VzA42n4xZDdRorY2kF2 Lz4CjN2aUJnQqP9iRi2V43I8dbrgfaLxggFGB39zX/SDrNM5DTO7jBooV5xdvZtzJ0V9p/2ZWzw hg= X-Google-Smtp-Source: AGHT+IGgvSii2qou0nbasH4eSHiSoBFowK31SfpKfRrvutxDEJZn+jiWbXnxMP7M2xZrNeBnQBD5vA== X-Received: by 2002:a05:690c:650e:b0:786:6383:65ab with SMTP id 00721157ae682-78663837b69mr33977747b3.66.1762102365003; Sun, 02 Nov 2025 08:52:45 -0800 (PST) Received: from ?IPV6:2600:1700:8952:80:44d4:5d8e:5f46:70a9? ([2600:1700:8952:80:44d4:5d8e:5f46:70a9]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7864c6645adsm22766387b3.40.2025.11.02.08.52.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Nov 2025 08:52:42 -0800 (PST) Message-ID: <4b3b0ed7-7a84-4ac5-bd3d-567958a30a4d@gmail.com> Date: Sun, 2 Nov 2025 10:52:52 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: C nitpick about pgwin32_dispatch_queued_signals() To: Laurenz Albe , Tom Lane Cc: pgsql-hackers@lists.postgresql.org References: <9c55d148-17c5-4d3a-96a1-7ece939a202a@gmail.com> <428507.1762102065@sss.pgh.pa.us> <61e4a1f457e84e725be3f92e272a4f8768c4d324.camel@cybertec.at> Content-Language: en-US From: Bryan Green In-Reply-To: <61e4a1f457e84e725be3f92e272a4f8768c4d324.camel@cybertec.at> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/2/2025 10:50 AM, Laurenz Albe wrote: > On Sun, 2025-11-02 at 11:47 -0500, Tom Lane wrote: >> Bryan Green writes: >>> On 11/2/2025 7:05 AM, Christian Ullrich wrote: >>>> the current MSVC compiler deems it necessary to issue >>>> warning C4053: one void operand for '?:' >>>> for a line with CHECK_FOR_INTERRUPTS(). This boils down to this bit of >>>> miscadmin.h (line 116 in master): >>>> >>>> #define INTERRUPTS_PENDING_CONDITION() \ >>>> (unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? >>>> pgwin32_dispatch_queued_signals() : 0, \ >>>> unlikely(InterruptPending)) >>>> #endif >>>> >>>> The C spec says that of the possible results of the :? operator, either >>>> none or both can be void, and pgwin32_dispatch_queued_signals() is void >>>> (and has been as far back as I can find it). >> >>> Yeah, this is a bug, or at least a spec violation. We should fix it in >>> my opinion-- it's non-conforming C. Others may disagree, though. >> >> Agreed. >> >> >> Let's go with your #1 (casting the 0 to void). >> But can't we simplify that to just >> >> #define INTERRUPTS_PENDING_CONDITION() \ >> (unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? >> pgwin32_dispatch_queued_signals() : (void) 0, \ >> unlikely(InterruptPending)) >> #endif >> >> that is, the only change needed is s/0/(void) 0/. > > +1 > > Laurenz Albe Option 1 works for me as well. Hopefully, it works for Christian as well.