Unexpected issue (for me).
I would have expected that the compiler should complain that psize is computed but unused.
Why isn't -Wunused-variable enabled in OpenZFS?
I would have expected that the compiler should complain that psize is computed but unused.
Why isn't -Wunused-variable enabled in OpenZFS?
Arguably every unused variable in the code base is a potential bug like this waiting to chomp on some poor user’s data though, so arguably they should be turning it on & dealing with the consequences?
Most definitely, yes.
In general (for any programming language, really), I would advocate for enabling warnings and address them as you go along.
Because that unlocks the developer feature of being able to react when code changes introduces warnings, as they generally point to unsound code.