Skip to content

Commit 78d542b

Browse files
committed
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
1 parent 6b4b8d5 commit 78d542b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/include/miscadmin.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ extern void ProcessInterrupts(void);
109109
(unlikely(InterruptPending))
110110
#else
111111
#define INTERRUPTS_PENDING_CONDITION() \
112-
(unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? pgwin32_dispatch_queued_signals() : 0, \
112+
(unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? \
113+
pgwin32_dispatch_queued_signals() : (void) 0, \
113114
unlikely(InterruptPending))
114115
#endif
115116

0 commit comments

Comments
 (0)