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
Thanks for this, this is a very interesting project.
I'm translating a large single file project, where most functions validate arguments using assert(3). All these functions are omitted from the generated rust. That was confusing me for a while, until I discovered the -a="--fail-on-error" option which gives a hint in the logfile:
DEBUG:root:thread 'main' panicked at 'Failed translating declaration due to error:
Statement expression didn't end in an expression: If { scrutinee: CExprId(13370),
true_variant: CStmtId(13371), false_variant: Some(CStmtId(13372)) },
kind: Some(Function { is_extern: false, is_inline: false, is_implicit: false,
typ: CTypeId(2606), name: "tdefl_flush_block",
parameters: [CDeclId(2609), CDeclId(2610)], body: Some(CStmtId(2608)) })',
src/translator.rs:251:9
That's weird, I thought, because this function contains no expression-flavour if statements. But it's actually the asserts, because glibc's assert here looks like:
Thanks for this, this is a very interesting project.
I'm translating a large single file project, where most functions validate arguments using assert(3). All these functions are omitted from the generated rust. That was confusing me for a while, until I discovered the
-a="--fail-on-error"
option which gives a hint in the logfile:That's weird, I thought, because this function contains no expression-flavour if statements. But it's actually the asserts, because glibc's assert here looks like:
Preprocessing-out asserts with -DNDEBUG fixes this.
The text was updated successfully, but these errors were encountered: