Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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]


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: