Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build: wrap logged enums with fmt::underlying #605

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thotypous
Copy link

With fmt v10+, build currently fails:

/usr/include/spdlog/logger.h:140:12:   required from ‘void spdlog::logger::info(fmt::v11::format_string<T ...>, Args&& ...) [with Args = {const unsigned int&, const hal::module_identification::MultithreadingPriority&}; fmt::v11::format_string<T ...> = fmt::v11::fstring<const unsigned int&, const hal::module_identification::MultithreadingPriority&>]’
  140 |         log(level::info, fmt, std::forward<Args>(args)...);
      |         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/hal-emsec/plugins/module_identification/src/api/module_identification.cpp:409:17:   required from here
   70 | #define log_info(channel, ...) LOG_CHANNEL(channel)->info(__VA_ARGS__)
      |                                                          ^
/usr/include/fmt/base.h:2235:45: error: ‘fmt::v11::detail::type_is_unformattable_for<hal::module_identification::MultithreadingPriority, char> _’ has incomplete type
 2235 |     type_is_unformattable_for<T, char_type> _;
      |                                    

It turns out it is now needed to wrap enums with fmt::underlying. See also https://stackoverflow.com/a/77751342/13649511.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant