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

transpile: fix previously ignored enum usage in compound literals #1185

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

Yeaseen
Copy link
Contributor

@Yeaseen Yeaseen commented Dec 6, 2024

This is my first PR. I would appreciate any feedback.

Modification:

Testing

The added test case specifically checks for the correct assignment of enum values in buffer initialization using compound literals. This test has been integrated into the existing test suite and passed successfully, confirming the fix.

Please review the changes and provide feedback or approve the pull request. If further modifications are required, I am open to suggestions and will make the necessary adjustments.

Thank you for considering this contribution to improve the project's handling of enum types.

Added a test case to ensure correct initialization of buffers using enums in compound literals.
@Yeaseen
Copy link
Contributor Author

Yeaseen commented Dec 6, 2024

@kkysen it seems the checks are passed. I would appreciate any feedback; thank you!

@kkysen kkysen changed the title transpile: Fix: previously ignored enum usage in compound literals transpile: fix previously ignored enum usage in compound literals Dec 6, 2024
Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Congrats on your first PR!

It generally looks all good to me. I made a few suggestions for the test, but they're just little formatting/style things. The test itself looks good. The transpiler change @fw-immunant suggested looks good, though I don't know too much about that code, but if the test passes it should be good.

I also made a couple changes in the PR description directly. Notably, you need to use one of the GitHub issue closing keywords directly before mentioning the issue. So I deleted the "issue" in "resolves issue #1168".

tests/enums/src/enum_compound.c Outdated Show resolved Hide resolved
tests/enums/src/enum_compound.c Outdated Show resolved Hide resolved
tests/enums/src/enum_compound.c Outdated Show resolved Hide resolved
tests/enums/src/enum_compound.c Outdated Show resolved Hide resolved
@Yeaseen
Copy link
Contributor Author

Yeaseen commented Dec 6, 2024

Thanks, @kkysen. I learned a lot from your edit in the description. Also, I updated the suggestions you made.

@kkysen kkysen merged commit 43fb2f8 into immunant:master Dec 6, 2024
9 checks passed
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.

c2rust Translation Failure with Enums in Compound Literals
2 participants