pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add pg_assume(expr) macro
Date: Wed, 09 Jul 2025 23:20:25 +0000
Message-ID: <E1uZe5R-005UkZ-1g@gemulon.postgresql.org> (raw)

Add pg_assume(expr) macro

This macro can be used to avoid compiler warnings, particularly when using -O3
and not using assertions, and to get the compiler to generate better code.

A subsequent commit introduces a first user.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/3prdb6hkep3duglhsujrn52bkvnlkvhc54fzvph2emrsm4vodl@77yy6j4hkemb
Discussion: https://postgr.es/m/20230316172818.x6375uvheom3ibt2%40awork3.anarazel.de
Discussion: https://postgr.es/m/20240207203138.sknifhlppdtgtxnk%40awork3.anarazel.de

Branch
------
master

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

Modified Files
--------------
src/include/c.h | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)



Message-ID: <E1uZe5R-005UkZ-1g@gemulon.postgresql.org>
Permalink:  ../E1uZe5R-005UkZ-1g@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uZe5R-005UkZ-1g@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: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add pg_assume(expr) macro
  In-Reply-To: <E1uZe5R-005UkZ-1g@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