Conversation
The self-assignment test added in the previous commit is the first place that instantiates SbHash<unsigned int,int>::operator=() inside CoinTests.exe. That method calls coin_geq_prime_number(), a private Coin symbol not exported from the Windows DLL, so the test binary failed to link with "unresolved external symbol coin_geq_prime_number". Compile a copy of the (small, self-contained) implementation directly into the test executable, matching the existing dict.cpp precedent used elsewhere in this file for the same class of problem.
Dikluwe
force-pushed
the
fix/sbhash-04-noexcept-contract
branch
from
September 18, 2026 21:42
f935967 to
5d63abc
Compare
Dikluwe
force-pushed
the
fix/sbhash-04-noexcept-contract
branch
from
September 18, 2026 21:52
5d63abc to
f066f96
Compare
On Win64 with COIN_INTERNAL defined, only the unsigned-long-long overload of SbHashFunc is available. The test called SbHashFunc(0U), but the literal 0U is also a valid null-pointer-constant candidate for SbHashFunc's pointer overloads (const char *, const SoBase *, ...). GCC/Clang resolve this to the integral conversion unambiguously; MSVC reports it as an ambiguous call. Use a named unsigned int variable instead of the literal: a named value (even holding 0) is never a null-pointer constant, so the overload set is unambiguous on every compiler.
Dikluwe
force-pushed
the
fix/sbhash-04-noexcept-contract
branch
from
September 18, 2026 22:17
c4a89c4 to
c7adbf3
Compare
The SbHash_hashes_c_strings_without_an_SbString_temporary test calls SbHashFunc(const SbString &), a private Coin symbol defined out of line in src/base/SbString.cpp. Like coin_geq_prime_number() before it, this symbol is not exported from the Windows DLL, so linking CoinTests.exe failed with LNK2019. Compile a copy of the (small, self-contained) implementation directly into the test executable, matching the existing dict.cpp and CoinGeqPrimeNumberWin32TestSupport.cpp precedent in this file.
Dikluwe
marked this pull request as draft
September 20, 2026 02:48
30 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SbHashFuncoverloads and implicit key conversionsnoexceptstatic_assertconst char *directly without constructing a temporarySbString, while preserving the historical content hash and prime-bucket mappingStack
Depends on #752. Until the preceding PRs are merged, GitHub shows their commits here as well; the new change is the final hash-contract commit.
Testing
ctest --test-dir /tmp/coin-sbhash-pr-build --output-on-failure(8/8 passed)This is PR 4 of 6 in the
SbHashcleanup series.