Avoid mixing void and integer in a conditional expression.
authorTom Lane <[email protected]>
Sun, 2 Nov 2025 17:30:44 +0000 (12:30 -0500)
committerTom Lane <[email protected]>
Sun, 2 Nov 2025 17:31:27 +0000 (12:31 -0500)
commit78d542b2bc0a71370fae2334e8c5ace443dbd36e
tree54f3458291bd549389dc60c3494c2e4d88b37773
parent6b4b8d5f359b24ccfa16093ed7051d5034fd1344
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 <[email protected]>
Author: Bryan Green <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/cc4ef8db-f8dc-4347-8a22-e7ebf44c0308@chrullrich.net
Backpatch-through: 13
src/include/miscadmin.h