pgsql: Avoid mixing void and integer in a conditional expression.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid mixing void and integer in a conditional expression.
Date: 2025-11-02 17:31:50
Message-ID: E1vFbvi-004iJU-0T@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)chrullrich(dot)net>
Author: Bryan Green <dbryan(dot)green(at)gmail(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/cc4ef8db-f8dc-4347-8a22-e7ebf44c0308@chrullrich.net
Backpatch-through: 13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/645c1e2752d98dba2684a2c0d72aa788badb4908

Modified Files
--------------
src/include/miscadmin.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2025-11-02 18:34:50 pgsql: Remove obsolete nbtree equality key comments.
Previous Message Tom Lane 2025-11-01 18:02:06 pgsql: Remove unused variable in recovery/t/006_logical_decoding.pl.