Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)) { ... }


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: