https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83437
Segher Boessenkool <segher at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |segher at gcc dot gnu.org --- Comment #3 from Segher Boessenkool <segher at gcc dot gnu.org> --- Casting between incompatible function types is explicitly allowed, both in C and in C++. And many programs actually do this. Only actually *calling* a function via the wrong type is UB. You probably get too many warnings for -Wextra, and certainly for -Wall. "-Wbad-*" is a terrible name in any case (there is nothing bad about such a cast).