Cro: Maintain it With Zig
Cro: Maintain it With Zig
Posted Sep 12, 2021 2:28 UTC (Sun) by HelloWorld (guest, #56129)In reply to: Cro: Maintain it With Zig by tialaramex
Parent article: Cro: Maintain it With Zig
A particularly idiotic example is the rule from MISRA that every switch statement must have a default branch. The compiler can and will check exhaustiveness when switching over an “enum class” type, so the rule doesn't achieve anything useful here. But when you add a new enumerator to the enum class, your compiler will now no longer be able to warn you about a missed case, because those are already handled by the default branch! So this rule actively harms programmers by depriving them of a useful language feature.
And when it comes to MISRA, that's just the tip of the iceberg.
