[Bug c/83584] "ISO C forbids conversion of object pointer to function pointer type" -- no, not really

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Mon Jan 1 00:15:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83584

--- Comment #17 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
There are certainly cases where something that is undefined at compile 
time in ISO C (i.e. the undefinedness is a property of the program, not of 
a particular execution path through the program) are unconditional hard 
errors - when GCC does not have any support for defining any semantics for 
the undefined construct.

Since it's OK for such things to be unconditional hard errors, it's also 
OK for them to be unconditional pedwarns (subject to the general principle 
of not really wanting a warning without an option to turn it off - but at 
least, on-by-default pedwarns are OK).  And it's also OK for them to be 
pedwarns-if-pedantic.  But the wording should be improved (e.g. "does not 
permit" or "does not support" instead of "forbids"), and there may be a 
case for a separate option that could turn this diagnostic off when used 
with -pedantic / -pedantic-errors.


More information about the Gcc-bugs mailing list