Ticket #4 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

Wrapping an int should raise exception

Reported by: mcowlishaw Assigned to: lth
Type: defect Priority: major
Milestone: M2 Component: Spec
Version: 4 Keywords:
Cc:

Description

Mike Cowlishaw expressed concerns about int/uint security in the numbers discussion page:

"I believe the unpleasant effects go away if a 'wrap' of an int during arithmetic becomes some type of exception or overflow. The performance cost is negligible (typically a single compare and test after an operation) – and the types could then become extendable (later) to user-defined integer ranges, which would be really handy."

Wiki location=> discussion:numbers

Attachments

Change History

Changed 2 years ago by jeffdyer

  • owner set to lth
  • milestone changed from M0 to M1

WG says no exception. Assigning to Lars for further investigation.

Changed 2 years ago by lth

  • milestone changed from M1 to M2

Changed 1 year ago by lth

  • component changed from Proposals to Spec

Changed 1 year ago by lth

  • status changed from new to closed
  • resolution set to fixed

I think this has been resolved. Having removed "use int" and "use uint" there are no wrapping operators except in the uint32ops namespace, where there are functions that you have to call explicitly to get wrapping behavior.

Note: See TracTickets for help on using tickets.