Member initialization list warning flag

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

 



Hi,

Is there any param in the gcc which will warn about not initialized
class member from the initialization list?

Example:

class A {
  A() : number(-1) {}
private:
  std::string text;
  int number;
  void* badPointer;
};

I that case there should be two warnings:
1. About not initialized text
2. About not initialized badPointer

I see a lot of problems with forgotten initialized members by the
programmers.
Having this type of warning would safe a lot of time.
If something has already "safe" ctor, then we are good, but with
pointers we can have a big problem.

Regards
Zygmunt Ptak



[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