Date: Tue, 7 Jul 2026 14:17:36 -0400
>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?
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.
On Tue, Jul 7, 2026 at 1:42 PM Joseph Myers <josmyers_at_[hidden]> wrote:
> On Tue, 7 Jul 2026, Jāāā Gustedt via Liaison wrote:
>
> > Joshua,
> >
> > on Mon, 6 Jul 2026 11:15:28 -0400 you (Joshua Berne <
> berne_at_[hidden]>) wrote:
> >
> > > Is there any precedent for a control macro (one defined by users to
> > > alter the behavior of the program, not by the implementation itself)
> > > to begin with __? Or to begin with STDC? Or any other particular
> > > form? I could not find any other obvious examples in C or C++ other
> > > than NDEBUG whose naming convention we hopefully don't want to use as
> > > a precedent.
> >
> > We currently have `__STDC_WANT_IEC_60559_EXT__`,
> > `__STDC_WANT_IEC_60559_TYPES_EXT__` and `__STDC_WANT_LIB_EXT1__` that
> > have such a form and semantics.
>
> Note in this regard that there is no consistency in how different WANT
> macros are specified (the semantics of different values, requirements for
> consistency when different headers are included, reservations with
> external linkage). See
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2174.htm - various
> details of feature test macros have changed since 2017, but there still
> aren't any uniform conventions for their semantics.
>
> --
> Joseph S. Myers
> josmyers_at_[hidden]
>
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?
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.
On Tue, Jul 7, 2026 at 1:42 PM Joseph Myers <josmyers_at_[hidden]> wrote:
> On Tue, 7 Jul 2026, Jāāā Gustedt via Liaison wrote:
>
> > Joshua,
> >
> > on Mon, 6 Jul 2026 11:15:28 -0400 you (Joshua Berne <
> berne_at_[hidden]>) wrote:
> >
> > > Is there any precedent for a control macro (one defined by users to
> > > alter the behavior of the program, not by the implementation itself)
> > > to begin with __? Or to begin with STDC? Or any other particular
> > > form? I could not find any other obvious examples in C or C++ other
> > > than NDEBUG whose naming convention we hopefully don't want to use as
> > > a precedent.
> >
> > We currently have `__STDC_WANT_IEC_60559_EXT__`,
> > `__STDC_WANT_IEC_60559_TYPES_EXT__` and `__STDC_WANT_LIB_EXT1__` that
> > have such a form and semantics.
>
> Note in this regard that there is no consistency in how different WANT
> macros are specified (the semantics of different values, requirements for
> consistency when different headers are included, reservations with
> external linkage). See
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2174.htm - various
> details of feature test macros have changed since 2017, but there still
> aren't any uniform conventions for their semantics.
>
> --
> Joseph S. Myers
> josmyers_at_[hidden]
>
Received on 2026-07-07 18:17:52
