[<<][c][>>][..]
Tue Jul 12 11:08:46 CEST 2011

GCC not catching undefined variable error

With -Wall enabled, this undefined variable error is not caught:

  void foo(int arg) {
      int err;
      if (arg < 0) goto exit;
      err = 0;
  exit:
      return err;
  }

Might it be because of -O0, i.e. no data flow analysis performed?
Yep, absence of opti is the problem:

  cc1: warning: -Wuninitialized is not supported without -O




[Reply][About]
[<<][c][>>][..]