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

--- Comment #5 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
I think the best solution would be to use "V = void (*)(void);"

I quote from Joseph Myers e-mail from 10/10/2017 because I could not
express it any better:

"Sometimes an interface needs to store an arbitrary function type [...]
That's the sort of thing libffi 
does - so it inherently needs to be able to take pointers to arbitrary 
function types, which thus need to be converted to a generic function 
type, and the de facto generic function pointer type in C is void (*) 
(void).  (C11 6.11.6 says "The use of function declarators with empty 
parentheses (not prototype-format parameter type declarators) is an 
obsolescent feature.", so void (*) () is best avoided.)  Likewise 
interfaces such as dlsym (which happens to return void * along with a 
special case in POSIX requiring conversions between void * and function 
pointers to work, but void (*) (void) is the natural type for such 
interfaces to use).

Reply via email to