The C compilers have become incredible clever.
So you tested the source in the git?
In that case, the compiler is way too clever
int main() {
int count=0;
for(int i=2;i<2000;i++)
if (isPrime(i)){a
count++;
}
return 0;
}
You never read the value assigned to count, so it does not matter and the compiler starts optimizing it to:
int main() {
for(int i=2;i<2000;i++) isPrime(i);
return 0;
}
But now the value of isPrime is not used, so it keeps optimizing:
int main() {
for(int i=2;i<2000;i++) ;
return 0;
}
Now the loop is pointless, and the entire program is reduced to:
int main() {
return 0;
}
And that is a very, very fast program