Hacker News new | ask | show | jobs
by kazinator 1227 days ago
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]