atomicobject / heatshrink

data compression library for embedded/real-time systems
ISC License
1.31k stars 176 forks source link

Compilation fails on Centos 7 / Python3.6 (c compiler std definition) #60

Closed rng-zz closed 3 years ago

rng-zz commented 3 years ago

I'm running into an issue building heatshink2 on Centos 7 / Python3.6 with GCC 4.8.5:

heatshrink2/_heatshrink/heatshrink_encoder.c:430:10: note: use option -std=c99 or -std=gnu99 to compile your code

This looks exactly the same as this issue and the same solution resolved it for me:

diff --git a/setup.py b/setup.py
index f7d2c10..7cf6967 100644
--- a/setup.py
+++ b/setup.py
@@ -21,6 +21,7 @@ def find_version():
 EXT = '.pyx' if USE_CYTHON else '.c'

 heatshrink_module = Extension('heatshrink2.core',
+                              extra_compile_args=['-std=gnu99'],
                               include_dirs=[
                                   'heatshrink2/_heatshrink'
                               ],

Should I open a PR with this change?

silentbicycle commented 3 years ago

setup.py is not part of this project, and the Makefile in the project includes -std=c99: https://github.com/atomicobject/heatshrink/blob/master/Makefile#L15 (it should be c99 not gnu99)

The PR should go against whatever distribution is replacing the build config with their own.