fuel-specs
fuel-specs copied to clipboard
Unclear behaviour around flags `F_WRAPPING` & `F_UNSAFEMATH`
If the F_UNSAFEMATH flag is unset, an operation that would have set $err to true is instead a panic. If the F_WRAPPING flag is unset, an operation that would have set $of to a non-zero value is instead a panic.
It might be just me, but these make it sound like the user needs to take an action (ie: "unset" the flags) in order to have the panic behaviour. As panic is the default behaviour (and the flags are "unset" to start with), I propose the wording change to something like:
- If the F_UNSAFEMATH flag is set, an operation that would have panicked will instead set
$err
to a non-zero value. - If the F_WRAPPING flag is set, an operation that would have panicked will instead set
$of
to a non-zero value.
cc @adlerjohn
"Unset" here is more of a hardware term that means "zero." Since registers are all initialized to zero, by default the flag bits are all unset.
Yes, I get that "unset" here describes a state rather than a verb, but I still think the wording would be improved as suggested. I find it harder to parse than it needs to be.
Yes, agree the wording can be clearer.
https://github.com/FuelLabs/fuel-specs/pull/408#pullrequestreview-1122126294
@adlerjohn can this be closed?
This one still needs to be fixed as per the above comment.