huh@px:/tmp$ cat a.c
int main(int argc, char *argv[]) {
if (argc = 0)
return 1;
return 0;
}
huh@px:/tmp$ gcc -Wall a.c
a.c: In function 'main':
a.c:2: warning: suggest parentheses around assignment used as truth value
However the same issue happens in a lot of C-like languages, and not all of them have compilers that inform you of errors. But the habit works in all of them.
There are two different ways to catch this class of bug. Both have value.