biojppm / rapidyaml

Rapid YAML - a library to parse and emit YAML, and do it fast.
MIT License
568 stars 97 forks source link

compile error with clang on v0.7.2 #470

Open jdrouhard opened 2 weeks ago

jdrouhard commented 2 weeks ago

Using v0.7.2 with gcc and clang (both error in the same way) on linux yields:

In file included from _deps/rapidyaml-src/src/c4/yml/parse.cpp:4:
In file included from _deps/rapidyaml-src/src/c4/yml/node.hpp:8:
In file included from _deps/rapidyaml-src/src/c4/yml/tree.hpp:21:
In file included from _deps/rapidyaml-src/ext/c4core/src/c4/charconv.hpp:63:
In file included from _deps/rapidyaml-src/ext/c4core/src/c4/ext/fast_float.hpp:23:
_deps/rapidyaml-src/ext/c4core/src/c4/ext/fast_float_all.h:99:62: error: '_MSVC_LANG' is not defined, evaluates to 0 [-Werror,-Wundef]
   99 |   #if __has_include(<stdfloat>) && (__cplusplus > 202002L || _MSVC_LANG > 202002L)
      |                                                              ^
_deps/rapidyaml-src/ext/c4core/src/c4/ext/fast_float_all.h:283:5: error: '__STDCPP_FLOAT32_T__' is not defined, evaluates to 0 [-Werror,-Wundef]
  283 | #if __STDCPP_FLOAT32_T__
      |     ^
_deps/rapidyaml-src/ext/c4core/src/c4/ext/fast_float_all.h:286:5: error: '__STDCPP_FLOAT64_T__' is not defined, evaluates to 0 [-Werror,-Wundef]
  286 | #if __STDCPP_FLOAT64_T__
      |     ^
_deps/rapidyaml-src/ext/c4core/src/c4/ext/fast_float_all.h:3503:5: error: '__STDCPP_FLOAT32_T__' is not defined, evaluates to 0 [-Werror,-Wundef]
 3503 | #if __STDCPP_FLOAT32_T__ == 1
      |     ^
_deps/rapidyaml-src/ext/c4core/src/c4/ext/fast_float_all.h:3521:5: error: '__STDCPP_FLOAT64_T__' is not defined, evaluates to 0 [-Werror,-Wundef]
 3521 | #if __STDCPP_FLOAT64_T__ == 1
      |     ^
In file included from _deps/rapidyaml-src/src/c4/yml/parse.cpp:13:
_deps/rapidyaml-src/src/c4/yml/event_handler_tree.hpp:49:9: error: 'RYML_DBG' is not defined, evaluates to 0 [-Werror,-Wundef]
   49 |     #if RYML_DBG

Seems like an issue with c4core, but there also seems to be a RYML_DBG problem in this repo. That line 45 should probably be #ifdef RYML_DBG.