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
Add -Wno-strict-aliasing to CFLAGS to ignore gcc warning
GitHub issue #133 was raised by @archey:
Compilation issues due to strict aliasing
These errors occured when building with gcc 6.3:
```
gcc -pthread -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-all --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-x86_64-2.7/source/py_gpio.o -Wall -Werror -Wextra -Wno-missing-field-initializers
source/py_gpio.c: In function ‘py_event_detected’:
source/py_gpio.c:433:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
Py_RETURN_TRUE;
^~~~~~~~~~~~~~
source/py_gpio.c:435:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
Py_RETURN_FALSE;
^~~~~~~~~~~~~~~
source/py_gpio.c: In function ‘py_wait_for_edge’:
source/py_gpio.c:479:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
Py_RETURN_FALSE;
^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
```
Py_RETURN_TRUE and Py_RETURN_FALSE are part of the Python C API:
https://docs.python.org/2/c-api/bool.html
0 commit comments