On 10/12/2017 05:52 AM, Pedro Alves wrote:
On 10/11/2017 03:57 AM, Martin Sebor wrote:


[X] This can be function that takes an argument of an incomplete
type, such as:

  struct Incomplete;
  typedef void Uncallable (struct Incomplete);

Any function can safely be converted to Uncallable* without
the risk of being called with the wrong arguments.  The only
way to use an Uncallable* is to explicitly convert it to
a pointer to a function that can be called.

OOC, did you consider trying to get something like that added
to C proper, to some standard header?  I don't imagine that it'd
be much objectionable, and having a standard type may help
tooling give better diagnostics and suggestions.

Yes.  In light of this discussion I am thinking it might be
worthwhile to bring up the issue of generic function pointers
with WG14 for C2X.

Martin

Reply via email to