Re: git: 8d29d2429649 - main - libc: Restore prior C23 include guards
Date: Tue, 25 Aug 2026 17:34:07 UTC
Devin Teske <dteske@freebsd.org> writes: > If someone uses __STDC_VERSION_*_H__ to inject C23 syntax of their > own, they are asking the advertisement to do visibility's job. I may > be missing a case where that is the right test; I have not found it in > 7.1.2p6 yet. Imagine a single-header library (i.e. a big collection of static inline functions) that uses __STDC_VERSION_FOO_H__ to choose between a C23 solution and a backward-compatible solution. This header is then included in a C99 program and fails because we are advertising C23 features to a C99 program. It's really not that hard to understand. > Your predicate (__ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE) would make > the macros mean "this compilation can see C23 semantics from this > header." That is a policy we can talk about on its own. I would > rather not fold it into the _FOO_H_ restore, which was only POLA after > gmp. I don't know what you mean with “fold it into the _FOO_H_ restore”. The “_FOO_H_ restore” has already happened and we're not going to rewrite history. I am asking for this feature to be implemented correctly. DES -- Dag-Erling Smørgrav - des@FreeBSD.org