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

Kaz Kylheku <kkylheku at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kkylheku at gmail dot com

--- Comment #22 from Kaz Kylheku <kkylheku at gmail dot com> ---
(In reply to Pavel M from comment #21)
> FYI: Rationale for C, Revision 5.10, April-2003:
> > Even with an explicit cast, it is invalid to convert a function pointer to 
> > an object pointer or a pointer to void, or vice versa.

That means nothing; it's not even part of the standard document. In the
document itself, there are texts which are part of it, yet not "normative",
such as examples and footnotes.

The standard itself mentions the conversion as a common extension (not in a
normative way though, but at least in the document!)

Now the absence of a documented extension, it certainly isn't correct; it's
undefined behavior.

But it's not incorrect in a way that requires a diagnostic (when the required
cast is present).

The only diagnostic ever required when a pointer conversion is requested is
when the conversion isn't one of the ones allowed implicitly, and a correct
cast is missing.

The "absence of a documented extension" is irrelevant in the context of GCC,
which has the extension. That extension is at the cornerstone of the tech
stacks built on GCC, and required by POSIX.

It is not useful for the -pedantic option to pretend that GCC is some other
compiler which doesn't have any of its conforming extensions. 

Diagnostics like that could be useful to someone, but deserve their own
category, like -Wutmost-portability or something.

Someone who just wants the ISO-C-required situations diagnosed shouldn't have
to have these other diagnostics foisted on them.

You can always pick and choose diagnostics individually, but the categories are
useful, which is why they are there.

Reply via email to