C++ Logo

liaison

Advanced search

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

From: Joshua Berne <berne_at_[hidden]>
Date: Tue, 7 Jul 2026 15:15:21 -0400
__STDC_WANT_LIB_EXT1__ seems to be the outlier here, with the annex K
effects of defining it depending on how it is defined, while many other
effects of that macro (everything not in that annex it seems) only care
about whether the user defined the macro or not.

The semantics proposed in P3290 are the same as the WANT macros outside of
the annex K treatment, and the same as how NDEBUG behaves (where defining
it is all that matters, and what it expands to is irrelevant).

On Tue, Jul 7, 2026 at 3:06 PM Joseph Myers <josmyers_at_[hidden]> wrote:

> 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:15:35