Minres / SystemC-Components

A SystemC productivity library: https://minres.github.io/SystemC-Components/
https://www.minres.com/#opensource
Apache License 2.0
81 stars 21 forks source link

Fix fmt 10.x+ compatibility issue in vcd_trace.hh #51

Closed valgur closed 7 months ago

valgur commented 7 months ago

SCC fails to compile with fmt 10 due to and explicit formatter for sc_dt::sc_fxval_fast not being found:

fmt20600bf402265/p/include/fmt/core.h:1576:63: error: ‘fmt::v10::detail::type_is_unformattable_for<sc_dt::sc_fxval_fast, char> _’ has incomplete type
 1576 |     type_is_unformattable_for<T, typename Context::char_type> _;
      |                                                               ^
fmt20600bf402265/p/include/fmt/core.h:1580:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
 1580 |       formattable,
      |       ^~~~~~~~~~~

This PR suggests a workaround that simply casts the value to double before formatting.

This came up in an update for the SCC Conan recipe: https://github.com/conan-io/conan-center-index/pull/18715