I remember exactly such a warning with -Weffc++
Of course, you should be ready to compile in C ++ mode. (See below)
Edit I tested this: Unfortunately, this will not warn about POD types (i.e.) C. Here is a test:
struct HasPointer { int* resource; HasPointer() {}; ~HasPointer() {}; };
Compiled with
E:\mingw64>g++ test.c -Weffc++
Outputs
test.c:1:8: warning: 'struct HasPointer' has pointer data members [-Weffc++] struct HasPointer ^ test.c:1:8: warning: but does not override 'HasPointer(const HasPointer&)' [-Weffc++] test.c:1:8: warning: or 'operator=(const HasPointer&)' [-Weffc++] test.c: In constructor 'HasPointer::HasPointer()':
But exiting ctor / dtor, the warning is not even selected, therefore this option does not work for your code, even in C ++ compilation mode .
Compiling C code in C ++ mode:
(Use extern "C" ) to ensure binary compatibility. It is usually as simple as
extern "C" { # include "my.h" # include "stuff.h"
source share