]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Avoid mixing void and integer in a conditional expression.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 2 Nov 2025 17:30:44 +0000 (12:30 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 2 Nov 2025 17:31:12 +0000 (12:31 -0500)
commitd5e9c7115027a310ee6c4023c340a9c4adc1f26c
treeda50816eeb06483d5da42c4ab64b5f7141e9cdeb
parentd4e4cecace91bd91f77da1cf081df2dba1b76a41
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
src/include/miscadmin.h