When I try to compile the piece of code below, I get this warning:
warning: suggest parentheses around assignment used as truth value
Why does t
While that particular idiom is common, even more common is for people to use = when they mean ==. The convention when you really mean the = is to use an extra layer of parentheses:
=
==
while ((list = list->next)) { // yes, it's an assignment