-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Use self hosted translate-c for cImport #4025
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- fix use of undefined value - fix parenexprclass result not being suppressed - add an error and a TODO for access of an anonymous field
…xu-stage-2-cimport
According to C11 6.5.6.8, pointer arithmetic may not overflow. In fact, it may not even go more than 1 past the end of an object, or UB occurs. This is the same as Zig pointer arithmetic semantics, and so the `+` and `+=` operators rather than `+%` and `+%=` are appropriate for C-translated pointer arithmetic.
Block-local identifiers have block-local mangling numbers, and more consistent mangling is applied within blocks. Parameters, for example, are treated the same as other block-local variables, and are not mangled unless they conflict with another name in scope.
* `std.mem.Compare` is now `std.math.Order` and the enum tags renamed to follow new style convention. * `std.mem.compare` is renamed to `std.mem.order`. * new function `std.math.order`
Widening and truncating integer casting to different signedness works better now. For example `(unsigned long)-1` is now translated to zig code that compiles correctly.
This made macros which had an error being processed emit multiple times, causing the self-hosted compiler to fail to build.
This input file, for example, would produce duplicate identifiers in the translated Zig code: ``` #define bar err( #define bar err( ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is @Vexu's #3973, merged into a branch, with more commits.
Checklist:
-1
type coerced tounsigned long
static inline
)