-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix incorrect "uninitialized reference" problem #23
Comments
This issue is because the order in which an expression appers in code differs from that in which it is evaluated. For example, given this: for (p = q; p < q+n; p = r)
r = next(); when Probably I have to give this kind of detection up until a more formal form of control flow analysis is introduced. |
I'll have to look at the source code, but isn't it possible to just put the third expression on a stack that would then be popped once the scope ends? You basically need a pointer on whatever scope abstraction there is and delay the detection to there. |
Thanks for your comment. Sounds like a nice approach. The parse tree from int j, i;
goto label1;
label3:
j = i;
goto label2;
label1:
i = 0;
goto label3;
label2:
; The diagnostic for "uninitialized reference" was mistakenly included when I designed code to issue similar warnings, "defined but not used" and "set but not used". Rather introducing a workaround for a specific case, preparing a method to traverse parse trees following control flow would allow other useful diagnostics not to mention fixing the problem. |
Temporarily removed the check for uninitialized references. |
No description provided.
The text was updated successfully, but these errors were encountered: