Unexpected failure-to-warn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




#include <iostream>
using std::cout;

int main(void)
{
  const int w = w/3;
}

does not give a 'warning, w may be used uninitialised', even when compiled with g++ -Wall, even though that's clearly the case. I ran into this in real code - it's a common kind of thinko.

Is this a bug, or am I missing something subtle in the C standard?

Thomas Womack, Global Phasing Ltd.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux