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

doesn't compile in 2024 - error: this arithmetic operation will overflow #2

Open
refacktor opened this issue Aug 21, 2024 · 0 comments

Comments

@refacktor
Copy link

I've been looking for a simple archive utility that's free, fast, can handle multiple terabytes without crashing, works on Windows, uses a standard archive file format, and doesn't come loaded with adware. This rapidtar project seemed perfect. Unfortunately, I'm unable to get past cargo build:

error: this arithmetic operation will overflow
  --> librapidarchive\src\units\data.rs:82:80
   |
82 | ...from(1024 * 1024 * 1024 * 1024).unwrap())
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1073741824_i32 * 1024_i32`, which would overflow
   |
   = note: `#[deny(arithmetic_overflow)]` on by default

I did a bit of initial research and it looks like there were some changes in the handling of int overflow in Rust 2018. Maybe this just needs a cast to i64? I'll try to find some time to try a quick fix.

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

1 participant