https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115185
--- Comment #5 from Konstantin Kharlamov <Hi-Angel at yandex dot ru> --- (In reply to Konstantin Kharlamov from comment #3) > (In reply to Andrew Pinski from comment #2) > > It is included in -Wc++-compat . > > Cool, thanks! I'll add the warning to the list we compile the project with, > thank you! FWIW, I tried that yesterday and I think the cons of -Wc++-compat far overweight its pros. The immediate problem is that it starts to warn about every `MyType* foo = malloc(…)` construction due to `MyType*` and `void*` being different. So basically -Wc++-compat warns about every heap memory allocation, of which there are dozens and hundreds in every C file. This warning alone can't be turned off. So apparently you're supposed to replace every memory allocation with a custom macro that takes type of the variable as an additional parameter just to shove in a cast. This is such a huge and inconvenient task that I would be very surprised if anybody uses -Wc++-compat at all.