NIlesh Srivastava
NIlesh Srivastava

Reputation: 71

fmt 10 and above gives compilation error(format.cc) on building fmt

[05:40:03] : [Step 4/6] [ 4%] Building CXX object CMakeFiles/fmt.dir/src/format.cc.o

[05:40:03] : [Step 4/6] /root/usr/bin/g++ -Ifmt/11.0.2/include -fPIC -g -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/fmt.dir/src/format.cc.o -MF CMakeFiles/fmt.dir/src/format.cc.o.d -o CMakeFiles/fmt.dir/src/format.cc.o -c fmt/11.0.2/src/format.cc

[05:40:03]W: [Step 4/6] In file included from fmt/11.0.2/include/fmt/format.h:41:0,

[05:40:03]W: [Step 4/6] from fmt/11.0.2/include/fmt/format-inl.h:27,

[05:40:03]W: [Step 4/6] from fmt/11.0.2/src/format.cc:8:

[05:40:03]W: [Step 4/6] fmt/11.0.2/include/fmt/base.h: In instantiation of ‘void fmt::v11::detail::check_format_string(S) [with Args = {unsigned int&}; S = fmt::v11::formatterfmt::v11::detail::bigint::format(const fmt::v11::detail::bigint&, fmt::v11::format_context&) const::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<std::is_base_of<fmt::v11::detail::compile_string, S>::value, int>::type = 0]’:

[05:40:03]W: [Step 4/6] fmt/11.0.2/include/fmt/base.h:2887:41: required from ‘fmt::v11::basic_format_string<Char, Args>::basic_format_string(const S&) [with S = fmt::v11::formatterfmt::v11::detail::bigint::format(const fmt::v11::detail::bigint&, fmt::v11::format_context&) const::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<(std::is_convertible<const S&, fmt::v11::basic_string_view >::value || (std::is_base_of<fmt::v11::detail::compile_string, S>::value && std::is_constructiblefmt::v11::basic_string_view<Char, const S&>::value)), int>::type = 0; Char = char; Args = {unsigned int&}]’

[05:40:03]W: [Step 4/6] fmt/11.0.2/include/fmt/format-inl.h:1387:60: required from here

[05:40:03]W: [Step 4/6] fmt/11.0.2/include/fmt/base.h:2792:56: in constexpr expansion of ‘fmt::v11::detail::parse_format_string<true, char, fmt::v11::detail::format_string_checker<char, unsigned int> >(s, fmt::v11::detail::format_string_checker<char, unsigned int>(s))’

[05:40:03]W: [Step 4/6] fmt/11.0.2/include/fmt/base.h:2613:44: in constexpr expansion of ‘fmt::v11::detail::parse_replacement_field<char, fmt::v11::detail::format_string_checker<char, unsigned int>&>((p + 18446744073709551615u), end, ((fmt::v11::detail::format_string_checker<char, unsigned int>&)handler))’

[05:40:03]W: [Step 4/6] fmt/11.0.2/include/fmt/base.h:2591:13: in constexpr expansion of ‘(& handler)->fmt::v11::detail::format_string_checker<Char, Args>::on_format_specs<char, {unsigned int}>(adapter.fmt::v11::detail::parse_replacement_field(const Char*, const Char*, Handler&&) [with Char = char; Handler = fmt::v11::detail::format_string_checker<char, unsigned int>&]::id_adapter::arg_id, (begin + 1u), end)’

[05:40:03]W: [Step 4/6] fmt/11.0.2/include/fmt/base.h:2763:51: in constexpr expansion of ‘((fmt::v11::detail::format_string_checker<char, unsigned int>)this)->fmt::v11::detail::format_string_checker<char, unsigned int>::parse_funcs_[id](((fmt::v11::detail::format_string_checker<char, unsigned int>)this)->fmt::v11::detail::format_string_checker<char, unsigned int>::context_)’

[05:40:03]W: [Step 4/6] fmt/11.0.2/include/fmt/base.h:2677:55: in constexpr expansion of ‘fmt::v11::formatter<unsigned int, char, void>().fmt::v11::formatter<unsigned int, char, void>::.fmt::v11::detail::native_formatter<T, Char, TYPE>::parsefmt::v11::detail::compile_parse_context<char >(ctx)’

[05:40:03]W: [Step 4/6] fmt/11.0.2/include/fmt/base.h:2829:34: in constexpr expansion of ‘fmt::v11::detail::parse_format_specs((& ctx)->fmt::v11::detail::compile_parse_context::.fmt::v11::basic_format_parse_context::begin(), (& ctx)->fmt::v11::detail::compile_parse_context::.fmt::v11::basic_format_parse_context::end(), ((fmt::v11::detail::native_formatter<unsigned int, char, (fmt::v11::detail::type)2>*)this)->fmt::v11::detail::native_formatter<unsigned int, char, (fmt::v11::detail::type)2>::specs_, (& ctx)->fmt::v11::detail::compile_parse_context::, (fmt::v11::detail::type)2)’

[05:40:03]W: [Step 4/6] fmt/11.0.2/include/fmt/base.h:2792:77: internal compiler error: Segmentation fault

[05:40:03]W: [Step 4/6] FMT_CONSTEXPR bool error = (parse_format_string(s, checker(s)), true); ^

Upvotes: 0

Views: 75

Answers (1)

vitaut
vitaut

Reputation: 55665

It is a bug in the compiler (internal compiler error):

.../base.h:2792:77: internal compiler error: Segmentation fault

To workaround it you could try a different compiler or library version.

Upvotes: 0

Related Questions