-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler error in gcc 8.2.0 on Debian 10.x (buster) #308
Comments
Here is a workaround to get it to compile on Buster. Please note it has not been tested, just that the compilation passes. CFLAGS="-Wno-cast-function-type -Wno-format-truncation -Wno-sizeof-pointer-memaccess -Wno-stringop-overflow" python setup.py install |
@eliasbakken thanks, do you know if this would cause a regression in earlier versions of gcc where those options didn't exist yet? |
Sorry, I'm not familiar with the compiler options on older GCCs... |
You can cast via |
Debian 10 (Buster) has gcc 8.2 which warns about: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ The solution is to cast to '(PyCFunction)(void *)'
Debian 10 (Buster) has gcc 8.2 which warns about: error: ‘%s’ directive output may be truncated writing up to 19 bytes into a region of size between 10 and 59 [-Werror=format-truncation=] snprintf(path, sizeof(path), "%s/%s/state", ocp_dir, pinmux_dir);
Debian 10 (Buster) has gcc 8.2 which warns about: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ The solution is to cast to '(PyCFunction)(void *)'
Debian 10 (Buster) has gcc 8.2 which warns about: source/c_pwm.c:459:65: error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess] source/c_pwm.c:396:43: error: ‘%s’ directive output may be truncated writing up to 199 bytes into a region of size 100 [-Werror=format-truncation=]
Debian 10 (Buster) has gcc 8.2 which warns about: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ The solution is to cast to '(PyCFunction)(void *)'
It's fixed! Thanks! |
I was testing the new Debian "buster" image by @RobertCNelson and we noticed that the Adafruit_BBIO build was failing on compiler warnings. This seems to be due to the introduction of new compiler warnings in the more recent version of gcc that is on the buster image: https://rcn-ee.net/rootfs/bb.org/testing/2019-03-03/buster-iot/bone-debian-buster-iot-armhf-2019-03-03-4gb.img.xz a shot
NOTE: commit 0923b85 caused a regression in older versions of gcc. See issue #307
TODO: determine how to avoid compile failure in gcc 8.2.0 without causing a regression for gcc 6.3.0 in the current Debian 9.x "Stretch" images
The text was updated successfully, but these errors were encountered: