RoaringBitmap / RoaringBitmap/CRoaring
Mismatch in parameter type of binarySearch2 and callee code
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.9k
- Forks
- 334
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 17
Description
In the file array_util.c , the below functions have second parameter "n" of type "int32_t".
https://github.com/RoaringBitmap/CRoaring/blob/a512daf381ed97a8b9621fd25b88ae259f20969e/src/array_util.c#L695
https://github.com/RoaringBitmap/CRoaring/blob/a512daf381ed97a8b9621fd25b88ae259f20969e/src/array_util.c#L727
But when these functions are called, a variable of type "size_t" is passed.
This leads to a compilation warning for possible loss of data.
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.
Research direction
Start in src/array_util.c at the two functions linked around lines 695 and 727, then inspect their callers around lines 749-785. Confirm the parameter and argument types and run the project build or compiler checks. Done means the size_t-to-int32_t warning is no longer emitted without changing the intended binary-search behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100