We have a handle type declared like:
typedef void *config_h;
We have a function declared like:
void func(config_h hConfig);
I called it like this:
config_h hConfig;
func(&hConfig);
Not even a warning. Things I cannot change about this project: It is C++11
, and compiled with -fpermissive
. The config_h
typedef is done in a file that is also compiled by C compilers, btw..
I looked here: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Looked like -Wstrict-aliasing
might be the ticket, but it was not. I get loads of warnings about various pointer conversions, but not this one.
The question is "What is the narrowest warning (or preferably error) I can enable to prevent this problem?"
Bonus question: If stuff like this drives me nuts, is switching to clang
likely to pay dividends?