Skip to content

WIN32: fix comparison of different sizes into compute_cpu_set()#335

Open
carlo-bramini wants to merge 1 commit intoboostorg:developfrom
carlo-bramini:fix-win32-1
Open

WIN32: fix comparison of different sizes into compute_cpu_set()#335
carlo-bramini wants to merge 1 commit intoboostorg:developfrom
carlo-bramini:fix-win32-1

Conversation

@carlo-bramini
Copy link

Compiling with MinGW for x86_64/Aarch64 prints this warning:

libs/fiber/src/numa/windows/topology.cpp: In function ‘std::set<unsigned int> {anonymous}::compute_cpu_set(WORD, KAFFINITY)’:
libs/fiber/src/numa/windows/topology.cpp:93:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare]
   93 |         for ( int i = 0; i < sizeof( mask) * 8; ++i) {
      |                          ~~^~~~~~~~~~~~~~~~~~~

This is correct because sizeof() returns size_t, but hopefully it can be fixed with a tiny change, by simply replacing int with size_t.
This is not dangerous, however it's still useful for removing this annoying warning when compiling, if possible.

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