[Bug c++/83437] [8 Regression] bogus warning: cast between incompatible function types from ‘int (*)()’ to ‘V’ {aka ‘void* (*)()’ [-Wcast-function-type]

segher at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 15 16:34:00 GMT 2017


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).


More information about the Gcc-bugs mailing list