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

Update fmt lib to v9.0.0 #2471

Closed
YuZhangGHub opened this issue Aug 23, 2022 · 8 comments
Closed

Update fmt lib to v9.0.0 #2471

YuZhangGHub opened this issue Aug 23, 2022 · 8 comments

Comments

@YuZhangGHub
Copy link

YuZhangGHub commented Aug 23, 2022

Hi fmt v9.0.0 has a big update and better implementation on snprintf and output. Please update it. Thanks.

@xbreak
Copy link

xbreak commented Sep 21, 2022

Note that fmt v9.0.0 deprecated automatic ostream formatting that may need additional consideration by spdlog (I'm currently evaluating spdlog v1.10.0 with fmt v9.1.0):

Disabled automatic std::ostream insertion operator (operator<<) discovery when fmt/ostream.h is included to prevent ODR violations. You can get the old behavior by defining FMT_DEPRECATED_OSTREAM but this will be removed in the next major release. Use fmt::streamed or fmt::ostream_formatter to enable formatting via std::ostream instead.

https://github.com/fmtlib/fmt/releases/tag/9.0.0

@gabime
Copy link
Owner

gabime commented Sep 21, 2022

Thanks for the heads up. what additional consideration is needed?

@xbreak
Copy link

xbreak commented Sep 21, 2022

I'm not sure if you or your users would consider it a breaking change in spdlog if automatic ostream formatting disappears for example.

@offa
Copy link
Contributor

offa commented Sep 29, 2022

An argument for the update is that fmt v9.x fixes a deprecation warning on newer Clang version with C++20 (fmtlib/fmt#2408).

@SX91
Copy link

SX91 commented Oct 27, 2022

I'm not sure if you or your users would consider it a breaking change in spdlog if automatic ostream formatting disappears for example.

The old behaviour could be activated with FMT_DEPRECATED_OSTREAM definition. It would be removed in future major fmtlib releases (as stated in release notes for 9.0.0). Yet it still could be used as a workaround to introduce 9.x.x support without breaking backward compatibility.

@gabime
Copy link
Owner

gabime commented Oct 27, 2022

Thanks for the info @SX91 !
For the upcoming spdlog release I will have to consider this (whether to define FMT_DEPRECATED_OSTREAM or not).

@SX91
Copy link

SX91 commented Oct 28, 2022

Hello, @gabime ! Thanks for your reply.

I think, leaving this problem to end user would break existing code, which relies on auto ostream-based formatting.
Sure, user could add this definition manually on cmake level, but it would be nice to have an option to disable deprecated behaviour (enabled by default) via cmake option or tweakme.h. At least until next major fmtlib upgrade.

If there's no other backwards incompatible changes in spdlog that is.

@gabime
Copy link
Owner

gabime commented Oct 31, 2022

Updated to fmt version 9.1.0. Preserved for this version the deprecated ostream formatting by defining FMT_DEPRECATED_OSTREAM

@gabime gabime closed this as completed Oct 31, 2022
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

No branches or pull requests

5 participants