3 ms·
As long as the set is limited (as enums usually are), you can always go with the middle ground between omitted case and catch all: case FILE_NOT_FOUND:
by gray_-_wolf 2y ago
As long as the set is limited (as enums usually are), you can always go with the middle ground between omitted case and catch all:
case FILE_NOT_FOUND:
/* This is normal, nothing to do. */
break;
This should still catch adding new value into the enum and not handling it.
- ReleaseCandidat 2y agoI should have added that this solution stops working as soon as you're handling 5 out of 50 cases. Lexical tokens are which always trigger the mentioned problems in my code - often you match against subsets, are there are _way_ too many of them to add them all explicitly.