Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



The blog post suggests that, probably because it’s never been used, it’s just too noisy to turn on.

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?


> so arguably they should be turning it on & dealing with the consequences?

Most definitely, yes.


FWIW: I learned in a sibling comment, that this compiler flag doesn't produce a warning in this specific case anyway (but I think it should!).

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: