3 ms·
You can also avoid using `default' statement in C, and use gcc -Wall while compiling. You'll get warning for missing enum values in `case' statements. You even
by ordu 10y ago
You can also avoid using `default' statement in C, and use gcc -Wall while compiling. You'll get warning for missing enum values in `case' statements. You even can add -Werror and get errors when some enum values left unused.
But when you have a really big enum and need to handle only small subset of it's values it didn't work.
When _this_ problem can be avoided in Rust, it can be avoided in C also. The only Rust bonus here is compiler default behaviour.