Reputation: 21808
Consider this simple class
class A
{
public:
int a;
};
As you can see int a
has never been initialized. I would like to get an error or at least warning in such cases. I'm using Xcode
with GNU++11[-std=gnu++11]
C++ dialect. Is it even possible?
UPDATE:
First of all I created an instance of A
and used its a
member and still received no warning:
A a;
std::cout << a.a;
Also I looked into Easy way to find initialized member variables, it suggests adding -Weffc++
flag. I tried to add it via custom compiler flags in the Xcode Build Settings (is it a wrong way to do so? I'm not sure) and it didn't work
Upvotes: 1
Views: 796