0

The following C++ snippet will compile using G++ 4.8.4:

double x = std::abs(x);

It will generate a warning, though:

warning: variable 'x' is uninitialized when used within its own initialization [-Wuninitialized]

Why is that even allowed? Is there any use for such a construct? Or is it compiler-dependent?

Greg
  • 6,038
  • 4
  • 22
  • 37

0 Answers0