-
Notifications
You must be signed in to change notification settings - Fork 14
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
Unintuitive behavior when omitting type specifier: APPROX x = 1; #34
Comments
I don't understand what "clearly shouldn't be allowed". Declaring another variable inside the loop scope is allowed in C++. And the "x" the return statement refers to is the one outside the loop. The On Monday, February 9, 2015, Bill [email protected] wrote:
André Oliveira |
@andreolb It's the |
Right, I understand now. Thanks! On Mon, Feb 9, 2015 at 10:44 PM, Adrian Sampson [email protected]
André Oliveira |
Actually, thinking more carefully about it, maybe it's just fine (tell me ACCEPT just recognizes statements that starts with "APPROX" as a On Mon, Feb 9, 2015 at 10:47 PM, Andre Oliveira [email protected] wrote:
André Oliveira |
Yeah, I guess it does—the error message does say that. I mostly just wish the error said "did you mean to leave off APPROX?" instead of "did you mean to insert int?" which seems less likely. |
I agree, but maybe the misunderstanding is due to the C compiler, not to foo(int a) { I think it's much more likely that the programmer forgot to specify the On Mon, Feb 9, 2015 at 10:59 PM, Adrian Sampson [email protected]
André Oliveira |
Based on my experience, this wouldn't be a problem if the warning were more visible to the user. In practice, it's highly likely that whatever warning is generated will blend in with all the other warnings that the APPROX notation tends to cause. I first hit this feature while annotating the perfect benchmarks, and had no idea it even produced a warning until I tried to reproduce it. |
Explanation in comments.
The text was updated successfully, but these errors were encountered: