Skip to content

C23 support#293

Open
olehlo wants to merge 2 commits intotree-sitter:masterfrom
olehlo:c23-support
Open

C23 support#293
olehlo wants to merge 2 commits intotree-sitter:masterfrom
olehlo:c23-support

Conversation

@olehlo
Copy link

@olehlo olehlo commented Dec 11, 2025

Adds missing C23 support.

Closes #290
Closes #273
Closes #261

@olehlo olehlo force-pushed the c23-support branch 9 times, most recently from b44e833 to 2154e4f Compare December 11, 2025 11:34
@zhaob1n
Copy link

zhaob1n commented Dec 16, 2025

Hi, I just posted 2 issues #295 #294 to ask for _Defer and _Countof supports, and it seems you have already supported _Countof. Thank you for your effort!

For your MR, I think countof should not be a keyword for now, it's defined as a macro in stdcountof.h. maybe in the future it will become a keyword, but not now.

@olehlo
Copy link
Author

olehlo commented Dec 16, 2025

Hey!
Perhaps _Countof should not be a part of this PR at all? With a separate PR for C2Y support with _Defer, _Countof?

@zhaob1n
Copy link

zhaob1n commented Dec 16, 2025

Hey! Perhaps _Countof should not be a part of this PR at all? With a separate PR for C2Y support with _Defer, _Countof?

Yes I think so.

@olehlo olehlo force-pushed the c23-support branch 2 times, most recently from 3b34bb4 to 216df82 Compare December 16, 2025 10:26
This commit adds support for new types, preprocessor directives,
keywords added in C23.
Also allows arbitrary amount of types to be passed into a macro,
enhancing support for "generic" macros in C23/C2Y (N3037, N3332).

Keywords, types, directives added:
- "auto" type
- _BitInt(N), _FloatN, FloatNx, _DecimalN, _DecimalNx
- typeof, typeof_unqual, countof, _Countof, alignof, alignas,
static_assert, _Static_assert
- #embed, #warning, #error, #elifdef, #elifndef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Support C23 new primitive types like _Float32 feature: Support for C23's typeof() feature: c23 _BitInt(N) and auto support

2 participants