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

Inconsistent error in analysis #152

Open
chqrlie opened this issue Jan 20, 2025 · 1 comment
Open

Inconsistent error in analysis #152

chqrlie opened this issue Jan 20, 2025 · 1 comment

Comments

@chqrlie
Copy link
Contributor

chqrlie commented Jan 20, 2025

I had a surprising behavior for my latest patch, where c2c reports an error on linux platform but not on Darwin:

parser/c2_tokenizer.c2:1559:11: error: implicit conversion changes signedness: 'u8' to 'i32'
    i32 c = *p++;
          ^

p is defined as const u8 *p;

This is a problem for 2 reasons:

  • the error is not reported on Darwin, hence there must be something fishy going on that makes the behavior platform dependent where it should not.
  • storing an unsigned 8-bit value into a 32-bit signed integer should not be considered an error: the value is preserved, the signedness is irrelevant in this operation and the workaround using a cast is ugly and risky (as all casts).
@bvdberg
Copy link
Member

bvdberg commented Feb 1, 2025

Does it still occur? I cannot reproduce it under Linux

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

No branches or pull requests

2 participants