ChimeraTK / ChimeraTK/ControlSystemAdapter
TypeChangingRangeChecking decorator throws boost::numeric::{postive|negative}_overflow in preWrite
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
If the exposed type is smaller than the wrapped type, Trying to write a value that exceeds the limits of the wrapped type will cause preWrite() to throw a boost::numeric::positive_overflow or ::negative_overflow.
This violates the TransferElement specification
If we do not declare it obsolete completely, the RangeChecking type should check type sizes on construction depending on its direction:
- rw is illegal
- ro widens the type from target type to decorator type (Example: target is uint8_t, decorator is int)
- wo narrows the type from target type to decorator type (Example: target is double, decorator is float)
such that range issues during the runtime cannot happen.
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 by tracing TypeChangingRangeChecking and RangeChecking through preWrite(), then consult the TransferElement specification referenced in the issue. Check how rw, ro, and wo directions handle target and decorator type sizes; done means invalid combinations are rejected at construction and runtime range errors do not produce the reported boost::numeric overflow exceptions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100