Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: use c11 everywhere #3088

Merged
merged 4 commits into from Feb 27, 2024
Merged

build: use c11 everywhere #3088

merged 4 commits into from Feb 27, 2024

Conversation

ObserverOfTime
Copy link
Member

This should allow core to use the same header while disabling it by default in scanners, though I haven't tested it.

I changed the name to TREE_SITTER_REUSE_ALLOCATOR to be more consistent with TREE_SITTER_FEATURE_WASM.

@maxbrunsfeld
Copy link
Contributor

Do we need to require C11 mode? What newer C features are we using?

Package.swift Outdated Show resolved Hide resolved
build.zig Outdated Show resolved Hide resolved
lib/binding_rust/build.rs Outdated Show resolved Hide resolved
lib/compile_flags.txt Outdated Show resolved Hide resolved
script/generate-bindings Outdated Show resolved Hide resolved
@amaanq
Copy link
Member

amaanq commented Feb 27, 2024

Do we need to require C11 mode? What newer C features are we using?

anonymous unions, a bit more info here and here

@maxbrunsfeld
Copy link
Contributor

anonymous unions

I see, thanks. Do you have a sense of how widely-supported the C11 standard is? What's the difference between gnu11 vs c11?

@ObserverOfTime
Copy link
Member Author

According to Wikipedia it should be supported in every non-EOL system:

Some features of C11 are supported by the GCC starting with version 4.6,[16] Clang starting with version 3.1,[17] IBM XL C starting with version 12.1,[18] and Microsoft Visual C++ starting with VS 2019 (16.8)[19] in September 2020.

gnu11 enables GNU extensions.
The Makefile already used it so I added it everywhere in core.
Parsers/scanners likely won't need any extensions so I made them c11.

@ObserverOfTime ObserverOfTime changed the title refactor: deduplicate alloc header build: use c11 everywhere Feb 27, 2024
lib/compile_flags.txt Outdated Show resolved Hide resolved
@amaanq amaanq merged commit 502dacf into tree-sitter:master Feb 27, 2024
2 checks passed
@github-actions github-actions bot removed the request for review from maxbrunsfeld February 27, 2024 20:54
@ObserverOfTime ObserverOfTime deleted the alloc branch February 28, 2024 09:43
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.

None yet

3 participants