Skip to content

Commit d4d701a

Browse files
ffontaineifduyue
authored andcommitted
setup.py: fix build with gcc 4.8
Fix the following build failure on gcc 4.8 which is raised since version 2.0.0 and 9084152: vendor/hiredis/read.c: In function 'redisReaderFree': vendor/hiredis/read.c:646:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < r->tasks; i++) { ^ vendor/hiredis/read.c:646:9: note: use option -std=c99 or -std=gnu99 to compile your code This build failure is raised because hiredis source code is built without C99: redis/hiredis@13a35bd Fixes: - http://autobuild.buildroot.org/results/04cbcddf6d83ebad8c98400754f9445375e9e489 Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent cca535d commit d4d701a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def version():
1313
ext = Extension("hiredis.hiredis",
1414
sources=sorted(glob.glob("src/*.c") +
1515
["vendor/hiredis/%s.c" % src for src in ("alloc", "read", "sds")]),
16+
extra_compile_args=["-std=c99"],
1617
include_dirs=["vendor"])
1718

1819
setup(

0 commit comments

Comments
 (0)