And looks like static type-checkers missed it because there's so much implicit unchecked type conversion in the kernel that that check is disabled due to the amount of noise.
The reason implicit conversion warnings are not enabled a legacy codebase is that nobody has the time to fix the 10,000 that appear when you turn them on. Even if you enable the flag on a per-file basis and take them in batches, each warning requires individual reasoning to understand whether the conversion is safe and/or intentional.
But nowadays I would trust an LLM to do this kind of migration with sufficient adversarial testing and randomly-sampled human review. You could sic a brand new Fable agent on each warning if you had the tokens.
> Even if you enable the flag on a per-file basis and take them in batches, each warning requires individual reasoning to understand whether the conversion is safe and/or intentional.
Even if it takes time it's the right direction. FreeBSD has WARNS level set per directory which is increased after code in this directory cleaned up / modernized. I like this approach.