From 78d542b2bc0a71370fae2334e8c5ace443dbd36e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 2 Nov 2025 12:30:44 -0500 Subject: [PATCH] Avoid mixing void and integer in a conditional expression. The C standard says that the second and third arguments of a conditional operator shall be both void type or both not-void type. The Windows version of INTERRUPTS_PENDING_CONDITION() got this wrong. It's pretty harmless because the result of the operator is ignored anyway, but apparently recent versions of MSVC have started issuing a warning about it. Silence the warning by casting the dummy zero to void. Reported-by: Christian Ullrich Author: Bryan Green Reviewed-by: Tom Lane Discussion: https://postgr.es/m/cc4ef8db-f8dc-4347-8a22-e7ebf44c0308@chrullrich.net Backpatch-through: 13 --- src/include/miscadmin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 8ce6c13fffc..42087111eb8 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -109,7 +109,8 @@ extern void ProcessInterrupts(void); (unlikely(InterruptPending)) #else #define INTERRUPTS_PENDING_CONDITION() \ - (unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? pgwin32_dispatch_queued_signals() : 0, \ + (unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? \ + pgwin32_dispatch_queued_signals() : (void) 0, \ unlikely(InterruptPending)) #endif