Closed bjosv closed 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.
Wat! GNU C 99 is not standard C99! I thought CMake is complex but apparently it is also wrong...
Well spotted though!
Shouldn't we change so that CMake also uses -std=c99?
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..
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.
_XOPEN_SOURCE
where needed instead of require it to be defined when building using Make.### Alternative build using Makefile directly
section in the README howhiredis
is found.