Post

Replies

Boosts

Views

Activity

C23 `` missing from libSystem (FB24179855)
Filed FB24179855 for this. Posting here so others hitting similar limitations can track and/or reference it (Apple's triage reportedly weighs duplicate count). Issue <stdbit.h>, the C23 standard header for bit-manipulation utilities (stdc_leading_zeros, stdc_count_ones, stdc_bit_width, etc.) from C23 §7.18, is not present in the macOS SDK libSystem. Worth noting this is a libc/SDK gap, not a compiler gap. Apple Clang accepts -std=c23 fine, and <stdckdint.h> (also C23, also library-level, e.g. ckd_add) is already present and working correctly. So C23 library headers are clearly being landed in libSystem incrementally. stdbit.h just hasn't made it in yet. If anyone's found a workaround (other than falling back to __builtin_clz/__builtin_popcount etc.) or has visibility into whether this is scheduled, would be good to hear. Repro #include <stdbit.h> int main(void) { return stdc_leading_zeros((unsigned)0); } $ /usr/bin/cc -std=c23 repro.c repro.c:1:10: fatal error: 'stdbit.h' file not found 1 | #include <stdbit.h> | ^~~~~~~~~~ 1 error generated. Environment Apple clang version 21.0.0 (clang-2100.1.1.101) Target: arm64-apple-darwin25.6.0
1
0
170
1w
C23 `` missing from libSystem (FB24179855)
Filed FB24179855 for this. Posting here so others hitting similar limitations can track and/or reference it (Apple's triage reportedly weighs duplicate count). Issue <stdbit.h>, the C23 standard header for bit-manipulation utilities (stdc_leading_zeros, stdc_count_ones, stdc_bit_width, etc.) from C23 §7.18, is not present in the macOS SDK libSystem. Worth noting this is a libc/SDK gap, not a compiler gap. Apple Clang accepts -std=c23 fine, and <stdckdint.h> (also C23, also library-level, e.g. ckd_add) is already present and working correctly. So C23 library headers are clearly being landed in libSystem incrementally. stdbit.h just hasn't made it in yet. If anyone's found a workaround (other than falling back to __builtin_clz/__builtin_popcount etc.) or has visibility into whether this is scheduled, would be good to hear. Repro #include <stdbit.h> int main(void) { return stdc_leading_zeros((unsigned)0); } $ /usr/bin/cc -std=c23 repro.c repro.c:1:10: fatal error: 'stdbit.h' file not found 1 | #include <stdbit.h> | ^~~~~~~~~~ 1 error generated. Environment Apple clang version 21.0.0 (clang-2100.1.1.101) Target: arm64-apple-darwin25.6.0
Replies
1
Boosts
0
Views
170
Activity
1w