C++ Logo

liaison

Advanced search

Re: [isocpp-wg14/wg21-liaison] INVITE: SG22 Telecon 2026-07-08 04:30 PM UTC

From: Joseph Myers <josmyers_at_[hidden]>
Date: Tue, 7 Jul 2026 19:06:10 +0000 (UTC)
On Tue, 7 Jul 2026, Joshua Berne via Liaison wrote:

> From what I can see in C23 these macros all seem to have a consistent
> interpretation --- "If X is defined (by the user) at th epoint in the code
> where <y.h> is first included, ...". What part remains non-uniform?

Compare with __STDC_WANT_LIB_EXT1__ (Annex K): values 0 or 1 (rather than
being based on defined / undefined); implementation-defined what happens
if not defined; "shall be defined identically for all inclusions of any
headers from this annex".

> The primary difference between these and the macro we are discussing (and
> NDEBUG itself) is that they impact the *first* inclusion of the standard
> header, not every one. But given that we are talking about controlling a
> preprocessor macro that has historically been redefinable by re-including
> assert.h, I think that's not an overly surprising difference.

It may well make sense for macros that are intended to change program
behavior to behave differently compared to the WANT macros that enable
optional features.

I would however hope that all macros for configuring program behavior are
consistent with each other, rather than repeating the inconsistency seen
with WANT macros.

-- 
Joseph S. Myers
josmyers_at_[hidden]

Received on 2026-07-07 19:06:19