Signed/unsigned conversion in Boost.Python

Open
#510 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
50/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp, python
Domain
backend

Research direction

Inspect boost/include/boost/python/suite/indexing/detail/indexing_suite_detail.hpp at lines 176 and 611, checking the types returned or modified by the referenced operations. Update the signed/unsigned handling without changing behavior, then build or run the relevant Boost.Python checks and confirm the compiler warnings are resolved.

Written by the indexing model from the issue text.

Description

Using Boost v1.90

In boost/include/boost/python/suite/indexing/detail/indexing_suite_detail.hpp there are locals that have a signed/unsigned mismatch.

On L176, a local variable index declared as long is assigned to a return that can be unsigned (size_t).

Similarly, on L611, another local variable from is declared as long then operator+= is used for a variable that has an unsigned type.

This results in an unnecessarily wordy warning in the compiler (in my case msvc 14.2)

Dominant language
C++
Stars
537
Forks
223
Avg merge
11h 22m
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/python

All issues in boostorg/python

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.