You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code generated by Cython heavily uses function casts between function types which have incompatible signatures. GCC 8.1.1 (on Arch Linux) does not like this and reports many Werror=cast-function-type errors:
As -Wcast-function-type does not exist in previous GCC releases, adding it to the set of disabled warnings in setup.py will break building with older compilers.
In order to silence the warning, I can think of two possible ways:
either by adding code in setup.py which tries running $CC -Wcast-function-type on a dummy C file and adds -Wno-cast-function-type to the compiler flags if this succeeds,
or by adding a pragma which disables the warning flag for GCC versions which support it, in the Cython file (if adding inline C code at the beginning of the file is possible).
What do you think about these options?
The text was updated successfully, but these errors were encountered:
Indeed. It seems that gcc never warns for unknown warning which are disabled, even in old versions like 4.9.2:
$ gcc --version
gcc (Debian 4.9.2-10+deb8u1) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ echo 'int main(){return 0;}' > test.c
$ gcc -Wcast-function-type test.c
gcc: error: unrecognized command line option ‘-Wcast-function-type’
$ gcc -Wno-cast-function-type test.c
$
The code generated by Cython heavily uses function casts between function types which have incompatible signatures. GCC 8.1.1 (on Arch Linux) does not like this and reports many
Werror=cast-function-type
errors:Have you already encountered this issue?
As
-Wcast-function-type
does not exist in previous GCC releases, adding it to the set of disabled warnings insetup.py
will break building with older compilers.In order to silence the warning, I can think of two possible ways:
setup.py
which tries running$CC -Wcast-function-type
on a dummy C file and adds-Wno-cast-function-type
to the compiler flags if this succeeds,What do you think about these options?
The text was updated successfully, but these errors were encountered: