-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fmt local scope uint
conflicts with OpenCV's globally scoped uint
#2809
Comments
In general fixing nonsensical warnings like this is not a goal but a PR to suppress them would be welcome provided that it is not too intrusive. |
Ok. PR forthcoming... |
On a second thought, we shouldn't be obfuscating local names like this just because of some random library. You could use |
Argh, I'm half-way through the repro code and PR. OpenCV is the "big bad" here. For other that read this, I've confirmed three workarounds
#pragma warning(push)
#pragma warning(disable: 4459)
#include <fmt/format.h>
#pragma warning(pop) |
If you use CMake then you could, as @vitaut has pointed out, pass |
So, while my project includes headers from multiple external(/"system") sources which also define the type I think it should be fixed in fmt... |
Unfortunately, OpenCV has a globally scoped
uint
type. It causes a conflict with the locally scopeduint
used by fmt in 5 places.I request fmt tweak this local typename to avoid the conflict. In my experience, OpenCV will not change.
Setup
FMT_VERSION 80101
Repro
spdlog::error("asdasd");
Result
Build fails with errors indicating the the global OpenCV type
uint
is being hidden by fmt's localuint
Expected
Clean build, no errors.
Notes
uint
only occurs 5 times throughout fmt. I request those 5 have a simple change to avoid the conflict.For example, changing
uint
todbox_uint
The text was updated successfully, but these errors were encountered: