Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on overflow in unsigned->signed conversion #1153

Closed
pirapira opened this issue Oct 5, 2016 · 3 comments
Closed

Exception on overflow in unsigned->signed conversion #1153

pirapira opened this issue Oct 5, 2016 · 3 comments

Comments

@pirapira
Copy link
Member

pirapira commented Oct 5, 2016

When an unsigned integer is converted to a signed integer of the same size, in half the cases, the original number is not expressible in the target type. This is one form of overflow and it should cause an exception, following the discussion in #796.

@pirapira pirapira changed the title Exception on unsigned->signed conversion Exception on overflow in unsigned->signed conversion Oct 5, 2016
@chriseth
Copy link
Contributor

chriseth commented Oct 5, 2016

Are you talking about explicit conversions? I think we should not throw an exception for explicit conversions because otherwise there is no way to actually perform explicit overflow.

There have been suggestions to provide two types of explicit conversions with different error behaviour, but there is no proposal on syntax yet.

@pirapira
Copy link
Member Author

pirapira commented Oct 5, 2016

I'm trying to enumerate overflows in arithmetics.

@pirapira
Copy link
Member Author

Delegated back to #796.

axic pushed a commit that referenced this issue Nov 20, 2018
* Create eip-transient_storage.md

* Update eip-transient_storage.md

* Update eip-transient_storage.md

* Update eip-transient_storage.md

* Update eip-transient_storage.md

* Update eip-transient_storage.md

* Update eip-transient_storage.md

* Update and rename eip-transient_storage.md to eip-1153.md

* Add missing colon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants