Nordix / hiredis-cluster

C client library for Valkey/Redis Cluster. This project is used and sponsored by Ericsson. It is a fork of the now unmaintained hiredis-vip.
BSD 3-Clause "New" or "Revised" License
88 stars 43 forks source link

Improve Make builds and its README section #157

Closed bjosv closed 1 year ago

bjosv commented 1 year ago
bjosv commented 1 year ago

Good. Is the macro defined in the CMake file as well? It doesn't need to be explicit there either anymore.

It works fine without it in CMake builds..but I just spot a difference.. CMake uses -std=gnu99 when set(CMAKE_C_STANDARD 99) is defined in CMakeLists.txt, but our Makefile uses -std=99 and changing this in the Makefile works.

zuiderkwast commented 1 year ago

Wat! GNU C 99 is not standard C99! I thought CMake is complex but apparently it is also wrong...

Well spotted though!

zuiderkwast commented 1 year ago

Shouldn't we change so that CMake also uses -std=c99?

bjosv commented 1 year ago

I did a check before but couldn't find a portable way via CMake, adding it manually depeding on compiler could be an option but annoying..

bjosv commented 1 year ago

Ah, now I see: https://cmake.org/cmake/help/latest/prop_tgt/C_EXTENSIONS.html#prop_tgt:C_EXTENSIONS

which is ON by default. Could be a way forward for it.