Message317853
> 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 |
|
Date |
User |
Action |
Args |
2018-05-28 14:23:22 | xdegaye | set | recipients:
+ xdegaye, vstinner, pmpp, martin.panter, serhiy.storchaka, ztane, eitan.adler, siddhesh, yan12125, cstratak, miss-islington |
2018-05-28 14:23:22 | xdegaye | set | messageid: <1527517402.62.0.682650639539.issue33012@psf.upfronthosting.co.za> |
2018-05-28 14:23:22 | xdegaye | link | issue33012 messages |
2018-05-28 14:23:22 | xdegaye | create | |
|