pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid mixing void and integer in a conditional expression.
Date: Sun, 02 Nov 2025 17:31:50 +0000
Message-ID: <E1vFbvi-004iJW-0X@gemulon.postgresql.org> (raw)

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

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fdbc6757276208bb87498d4f17ef884baf2e90fe

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



view thread (7+ messages)  latest in thread

Message-ID: <E1vFbvi-004iJW-0X@gemulon.postgresql.org>
Permalink:  ../E1vFbvi-004iJW-0X@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vFbvi-004iJW-0X@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid mixing void and integer in a conditional expression.
  In-Reply-To: <E1vFbvi-004iJW-0X@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox