compile discrete_distribution for 64-bit code
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 35/100
Research direction
Start in random/discrete_distribution.hpp around lines 499 and 507, and inspect how the loop index is passed to _impl.get_weight(). Compile the component with the MSVC 2010 64-bit compiler; done means the reported size_t-to-int32_t warning is no longer emitted.
Written by the indexing model from the issue text.
Description
When compiling discrete_distribution using MSVC 2010 64-bit compiler, warnings are emitted.
The key warning says:
warning C4267: 'argument' : conversion from 'size_t' to 'int32_t', possible loss of data
Cause of the issue:
In random/discrete_distribution.hpp, at line 507, the expression _impl.get_weight(i) tries to convert 'i' (a 'size_t') into 'IntType' (the parameter type of get_weight()).
However, 'IntType' is 'int' by default, which causes a conversion from 64-bit to 32-bit in a 64-bit environment.
Suggestions:
At line 499, 'i' is defined as a 'size_t'.
It should be safe to define it as an 'IntType':
IntType i = 0;.
- Dominant language
- C++
- Stars
- 42
- Forks
- 76
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 6
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/random
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Documentation
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Component: GLib
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
brave/brave-browser#59300 ·
-
Mute ydb/tests/functional/dstool/test_canonical_requests.py.Test.test_group_take_snapshot in main Openai_reviewed
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ydb-platform/ydb#53974 · 3 comments ·