Skip to content

Allow dollar sign $ in identifiers in translate-c - #7651

Merged
andrewrk merged 1 commit into
ziglang:masterfrom
ehaas:allow-dollar-identifiers
Jan 4, 2021
Merged

Allow dollar sign $ in identifiers in translate-c#7651
andrewrk merged 1 commit into
ziglang:masterfrom
ehaas:allow-dollar-identifiers

Conversation

@ehaas

@ehaasehaas commented Jan 2, 2021

Copy link
Copy Markdown
Contributor

In strictly conforming C, identifiers cannot container dollar signs.
However GCC and Clang allow them by default, so translate-c should
handle them. See http://gcc.gnu.org/onlinedocs/cpp/Tokenization.html
I encountered this in the wild in windows.h

Fixes#7585

@daurnimatordaurnimator added the translate-c C to Zig source translation feature (@cImport) label Jan 2, 2021
In strictly conforming C, identifiers cannot container dollar signs.
However GCC and Clang allow them by default, so translate-c should
handle them. See http://gcc.gnu.org/onlinedocs/cpp/Tokenization.html
I encountered this in the wild in windows.h
Fixesziglang#7585
@ehaas
ehaasforce-pushed the allow-dollar-identifiers branch from 29887a5 to 7988b6aCompareJanuary 4, 2021 03:35
@andrewrk
andrewrk merged commit d957244 into ziglang:masterJan 4, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

translate-cC to Zig source translation feature (@cImport)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unreachable code encountered in translate-c if macro has dollar sign

3 participants

@ehaas@andrewrk@daurnimator