pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid mixing void and integer in a conditional expression. 7+ messages / 1 participants [nested] [flat]
* pgsql: Avoid mixing void and integer in a conditional expression. @ 2025-11-02 17:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-11-02 17:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ master Details ------- https://git.postgresql.org/pg/commitdiff/645c1e2752d98dba2684a2c0d72aa788badb4908 Modified Files -------------- src/include/miscadmin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid mixing void and integer in a conditional expression. @ 2025-11-02 17:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-11-02 17:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid mixing void and integer in a conditional expression. @ 2025-11-02 17:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-11-02 17:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/436d9ed690ebad81df2f98d702e2578def002699 Modified Files -------------- src/include/miscadmin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid mixing void and integer in a conditional expression. @ 2025-11-02 17:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-11-02 17:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d5e9c7115027a310ee6c4023c340a9c4adc1f26c Modified Files -------------- src/include/miscadmin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid mixing void and integer in a conditional expression. @ 2025-11-02 17:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-11-02 17:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/cd55abab4fa451b28ea19041ee1c5260c79c8cbf Modified Files -------------- src/include/miscadmin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid mixing void and integer in a conditional expression. @ 2025-11-02 17:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-11-02 17:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d26997c71281def407df25e1fc7606f30a084681 Modified Files -------------- src/include/miscadmin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid mixing void and integer in a conditional expression. @ 2025-11-02 17:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-11-02 17:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/78d542b2bc0a71370fae2334e8c5ace443dbd36e Modified Files -------------- src/include/miscadmin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2025-11-02 17:31 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-11-02 17:31 pgsql: Avoid mixing void and integer in a conditional expression. Tom Lane <tgl@sss.pgh.pa.us> 2025-11-02 17:31 pgsql: Avoid mixing void and integer in a conditional expression. Tom Lane <tgl@sss.pgh.pa.us> 2025-11-02 17:31 pgsql: Avoid mixing void and integer in a conditional expression. Tom Lane <tgl@sss.pgh.pa.us> 2025-11-02 17:31 pgsql: Avoid mixing void and integer in a conditional expression. Tom Lane <tgl@sss.pgh.pa.us> 2025-11-02 17:31 pgsql: Avoid mixing void and integer in a conditional expression. Tom Lane <tgl@sss.pgh.pa.us> 2025-11-02 17:31 pgsql: Avoid mixing void and integer in a conditional expression. Tom Lane <tgl@sss.pgh.pa.us> 2025-11-02 17:31 pgsql: Avoid mixing void and integer in a conditional expression. Tom Lane <tgl@sss.pgh.pa.us>
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