Compiler warning – suggest parentheses around assignment used as truth value

Be explicit – then the compiler won’t warn that you perhaps made a mistake.

while ( (list = list->next) != NULL )

or

while ( (list = list->next) )

Some day you’ll be glad the compiler told you, people do make that mistake 😉

Leave a Comment