Xavier de Gaye <xdeg...@gmail.com> added the comment:

> Pedantically the correct way is to cast to a function pointer with no 
> prototype (empty parentheses)

Thanks for raising this point Antti. This is hinted at by the gcc 8 
documentation on -Wcast-function-type: "The function type void (*) (void) is 
special and matches everything, which can be used to suppress this warning" 
[1]. One cannot use empty parentheses though as this raises -Wstrict-prototypes 
on Python builds with gcc and -Wcast-function-type with gcc 8.

So (void *) may be replaced with (void (*) (void)) in my previous code snippets 
and also in PR 6748 and PR 6749 (I just checked my code).

[1] 
https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#Warning-Options

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33012>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to