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
Note here the *fresh0 = *fresh0 + 1;. This does not have the desired effect of modifying s.i. Instead, it modifies the temporary returned by s.i(), a temporary which is never again used after being assigned to.
The pre-decrement, on the other hand, is correctly translated into a call to s.set_i.
Tested using c2rust 0.16.0
This program returns zero. It is translated to a Rust program that returns -1.
The generated Rust code is
Note here the
*fresh0 = *fresh0 + 1;
. This does not have the desired effect of modifyings.i
. Instead, it modifies the temporary returned bys.i()
, a temporary which is never again used after being assigned to.The pre-decrement, on the other hand, is correctly translated into a call to
s.set_i
.One possible corrected translation would be
The text was updated successfully, but these errors were encountered: