For some reason I'm getting an error: statement with no effect on this statement.
for (j = idx; j < iter; j + increment) {
printf("from loop idx = %i", (int)idx);
punc(ctxt, j);
}
For some reason I'm getting an error: statement with no effect on this statement.
for (j = idx; j < iter; j + increment) {
printf("from loop idx = %i", (int)idx);
punc(ctxt, j);
}
You probably meant to write j += increment instead of j + increment.
I think you meant j += increment, as j + increment doesn't actually alter j or indeed have any side effects at all - it is a statement with no effect, which is what the compiler is telling you
increment is added to j in a forest and nobody hears noise from poor shielding in the on-board soundcard, did it really make a sound?You are getting that as an error? How cool, I wish my compiler did that. Basically j + increment will return the sum of those two, but j won't get modified so your loop would probably run forever.
gcc, the -Werror option (with -Wall) turns warnings to errors; -Werror=unused-value turns the specific warning in this question to an error.