pg.ddx.io pgsql-hackers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Bryan Green <dbryan.green@gmail.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: C nitpick about pgwin32_dispatch_queued_signals()
Date: Sun, 2 Nov 2025 10:52:52 -0600
Message-ID: <4b3b0ed7-7a84-4ac5-bd3d-567958a30a4d@gmail.com> (raw)
In-Reply-To: <61e4a1f457e84e725be3f92e272a4f8768c4d324.camel@cybertec.at>
References: <cc4ef8db-f8dc-4347-8a22-e7ebf44c0308@chrullrich.net>
<9c55d148-17c5-4d3a-96a1-7ece939a202a@gmail.com>
<428507.1762102065@sss.pgh.pa.us>
<61e4a1f457e84e725be3f92e272a4f8768c4d324.camel@cybertec.at>
On 11/2/2025 10:50 AM, Laurenz Albe wrote:
> On Sun, 2025-11-02 at 11:47 -0500, Tom Lane wrote:
>> Bryan Green <dbryan.green@gmail.com> 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.
view thread (5+ messages)
Message-ID: <4b3b0ed7-7a84-4ac5-bd3d-567958a30a4d@gmail.com> Permalink: ../4b3b0ed7-7a84-4ac5-bd3d-567958a30a4d@gmail.com/ Also on: postgresql.org/message-id/4b3b0ed7-7a84-4ac5-bd3d-567958a30a4d@gmail.com ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients using the --to and --cc options: reply via email To: pgsql-hackers@postgresql.org Cc: dbryan.green@gmail.com, laurenz.albe@cybertec.at, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org Subject: Re: C nitpick about pgwin32_dispatch_queued_signals() In-Reply-To: <4b3b0ed7-7a84-4ac5-bd3d-567958a30a4d@gmail.com> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox