0001-setup.py-fix-build-with-gcc-4.8.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 204898e28c7650089bf664eea8adfc16a22ba4f4 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Tue, 6 Apr 2021 10:37:49 +0200
  4. Subject: [PATCH] setup.py: fix build with gcc 4.8
  5. Fix the following build failure on gcc 4.8 which is raised since version
  6. 2.0.0 and
  7. https://github.com/redis/hiredis-py/commit/9084152f624e8e593b4e86ddf8bd13329fdfc043:
  8. vendor/hiredis/read.c: In function 'redisReaderFree':
  9. vendor/hiredis/read.c:646:9: error: 'for' loop initial declarations are only allowed in C99 mode
  10. for (int i = 0; i < r->tasks; i++) {
  11. ^
  12. vendor/hiredis/read.c:646:9: note: use option -std=c99 or -std=gnu99 to compile your code
  13. This build failure is raised because hiredis source code is built
  14. without C99:
  15. https://github.com/redis/hiredis/commit/13a35bdb64615e381c5e1151cdd4e78bba71a6db
  16. Fixes:
  17. - http://autobuild.buildroot.org/results/04cbcddf6d83ebad8c98400754f9445375e9e489
  18. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  19. [Upstream status: https://github.com/redis/hiredis-py/pull/110]
  20. ---
  21. setup.py | 1 +
  22. 1 file changed, 1 insertion(+)
  23. diff --git a/setup.py b/setup.py
  24. index d83153b..1f623c9 100755
  25. --- a/setup.py
  26. +++ b/setup.py
  27. @@ -13,6 +13,7 @@ def version():
  28. ext = Extension("hiredis.hiredis",
  29. sources=sorted(glob.glob("src/*.c") +
  30. ["vendor/hiredis/%s.c" % src for src in ("alloc", "read", "sds")]),
  31. + extra_compile_args=["-std=c99"],
  32. include_dirs=["vendor"])
  33. setup(
  34. --
  35. 2.30.2