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

Logic Operators short circuiting #18

Open
ghost opened this issue Mar 15, 2018 · 1 comment
Open

Logic Operators short circuiting #18

ghost opened this issue Mar 15, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 15, 2018

Do we need to worry about the short circuiting in C, as it can lead to edge cases in our evaluation. But its part of the spec. but also doesnt it count as a type of optimization? Shall we consider this when creating our compilers?

@fyquah
Copy link
Contributor

fyquah commented Mar 16, 2018

I am not sure what is in the assessment, but I assume you do. The following style of code, for eg, is fairly common in programs.

bool
first_element_greater_than_1(int *a, int len)
{
   return len > 0 && a[0] > 0;
}

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

1 participant