summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-11-02 12:30:44 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2025-11-02 12:30:44 -0500
commit645c1e2752d98dba2684a2c0d72aa788badb4908 (patch)
tree29a0b18bf56f08835c2900d457adda67ecab73ce /src
parentb70cafd85fb5040d49a4e026fa9798d4ed5de17b (diff)
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 <chris@chrullrich.net> Author: Bryan Green <dbryan.green@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/cc4ef8db-f8dc-4347-8a22-e7ebf44c0308@chrullrich.net Backpatch-through: 13
Diffstat (limited to 'src')
-rw-r--r--src/include/miscadmin.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 1bef98471c3..9a7d733ddef 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -114,7 +114,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