Reputation: 5787
Is there a way to print a warning if you forget to declare in ctor initialization list a member POD? I'm looking through docs and can't find anything. g++-4.4 here.
Upvotes: 7
Views: 1034
Reputation: 206546
You can use the option -Wuninitialized
(and also -Wall
).
However, It only warns if the Uninitialized type is being used.
Also, Ofcourse you can use other softwares like Valgrind and Cppcheck to determine Uninitialized types.
Upvotes: 3
Reputation: 477140
You can enable -Weffc++
to get a heap of ridiculous warnings, including every single non-ctor-initialized member.
To check for actual UB, use valgrind.
Upvotes: 5