Commit baf41fc
committed
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.html1 parent af620d5 commit baf41fc
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments