Skip to content

Avoid using uint as a type name - #3137

Merged
vitaut merged 1 commit into
fmtlib:masterfrom
Youw:patch-1
Oct 12, 2022
Merged

vitaut merged 1 commit into
fmtlib:masterfrom
Youw:patch-1

Conversation

@Youw

@Youw Youw commented Oct 12, 2022

Copy link
Copy Markdown
Contributor

Sometime uint is defined as a global type by the project's code directly or by some 3rdparty libraries (e.g. Qt or OpenCV). Some versions of MSVC (e.g. v16.11.15) gives a type shadowing warning:

3rdparty\fmtlib\fmt\include\fmt/format.h(3251): warning C4459: declaration of 'uint' hides global declaration
opencv2/core/hal/interface.h(45): note: see declaration of 'uint'

This also causes a compilation failure when /WX is used.

Sometime `uint` is defined as a global type by the project's code directly or by some 3rdparty libraries (e.g. Qt or OpenCV).
Some versions of MSVC (e.g. v16.11.15) gives a type shadowing warning:
```
3rdparty\fmtlib\fmt\include\fmt/format.h(3251): warning C4459: declaration of 'uint' hides global declaration
opencv2/core/hal/interface.h(45): note: see declaration of 'uint'
```
This also causes a compilation failure when `/WX` is used.
@vitaut

vitaut commented Oct 12, 2022

Copy link
Copy Markdown
Contributor

In general we don't try to workaround "conflicts" with third-party libraries but I guess this is a pretty minor change so we can make an exception this time.

@vitaut
vitaut merged commit cfb34a0 into fmtlib:master Oct 12, 2022
@Youw
Youw deleted the patch-1 branch October 13, 2022 09:51
@Youw

Youw commented Oct 18, 2022

Copy link
Copy Markdown
Contributor Author

Fixes: #2809

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.

2 participants