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

Run-time checks with char comparison should use char val not int val #56

Open
jennalwise opened this issue Sep 26, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jennalwise
Copy link
Member

In my cparser case study, I ran into a compiler issue in cc0 for a run-time check generated by the frontend containing 'c1->val == 0', which did not compile with cc0 because the type on the left is a char and the type on the right is an int. The original c0 program contains 'c1->val == '\0'', so the comparison produced is correct, because the backend is using the numeric value of 0 for '\0', which is the correct value. It is just unfortunate that c0 won't treat 0 implicitly as '\0' in this context.

So, we need to fix the frontend to translate numerics like this back into their ASCII char variant.

@jennalwise jennalwise added the bug Something isn't working label Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant