You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying c2rust on an open source project https://github.com/berkeley-abc/abc
I followed the instructions in README.md, installed c2rust from git (0.19.0), and generated compile_commands.json.
c2rust panicked and I could not figure out which part of the C code caused the problem.
Part of the command output of RUST_BACKTRACE=full c2rust transpile compile_commands.json
Transpiling abcDfs.c
thread 'main' panicked at c2rust-transpile/src/translator/mod.rs:233:47:
called `Option::unwrap()` on a `None` value
I assumed that it is abnormal that this unwrap would fail, but it just happened to me.
My idea is to return a error message containing self.name so that users are able to identify which C function caused the panic.
I'm fairly new to Rust, so I'm not sure if the program behavior is as intended, or it is an opportunity for me to work on a patch.
Full command output of RUST_BACKTRACE=full c2rust transpile compile_commands.json
Hi! Yes, this would be a fine place to help add some better error messages. The error handling in the transpiler is not very robust at all and mostly done by panicking, so adding better error messages would definitely help. Something like .unwrap_or_else(|| panic!("better error message")) would definitely be appreciated. Thanks!
I'm trying c2rust on an open source project https://github.com/berkeley-abc/abc
I followed the instructions in README.md, installed c2rust from git (0.19.0), and generated
compile_commands.json
.c2rust panicked and I could not figure out which part of the C code caused the problem.
Part of the command output of
RUST_BACKTRACE=full c2rust transpile compile_commands.json
I read the code
https://github.com/ChienKaiMa/c2rust/blob/9eaf8a15ede349a3ed9bff4af4638a80c88b8b65/c2rust-transpile/src/translator/mod.rs#L233
I assumed that it is abnormal that this unwrap would fail, but it just happened to me.
My idea is to return a error message containing
self.name
so that users are able to identify which C function caused the panic.I'm fairly new to Rust, so I'm not sure if the program behavior is as intended, or it is an opportunity for me to work on a patch.
Full command output of
RUST_BACKTRACE=full c2rust transpile compile_commands.json
The text was updated successfully, but these errors were encountered: