GCC has a warning for statements with no effect like x == foo();
$ echo "void f(int x) { x == g(); }" | gcc -Wall -W -x c -
<stdin>: In function ‘f’:
<stdin>:1:22: warning: implicit declaration of function ‘g’ [-Wimplicit-function-declaration]
<stdin>:1:19: warning: value computed is not used [-Wunused-value]