3 ms·
One thing is that the compiler can warn about missing cases when using enums (GCC optionally does this); with defines, it's not clear that several values form a
by _pmf_ 13y ago
One thing is that the compiler can warn about missing cases when using enums (GCC optionally does this); with defines, it's not clear that several values form a closed set.
The other thing is that function signatures can now show 'enum myenum e' instead of 'int v', which is much clearer.
- srl 13y ago> One thing is that the compiler can warn about missing cases when using enums (GCC optionally does this); with defines, it's not clear that several values form a closed set. But here, the values /don't/ form a closed set, and using enums would imply that they do.