News for hackers. Stuff that matters.
Re:Why Does “=” Mean Assignment? by OskarS on Tuesday April 10, 2018 @05:17PM (#16805530)
It's used often enough in loops like this:

    while (v = next()) { ... }
or, perhaps more usefully:

    while ((v = next()) != ERROR) { ... }
EDIT: just did a quick check, and LLVM did in fact warn me about this:

    if (x = 4) { ... }
To silence the error, you have to double up on the parenthesis, which I guess is a reasonable enough solution:

    if ((x = 4)) { ... }

There are no comments on this comment yet.