I know that c and c++ standards state that if you don't specify first element's value a start value of enum will default to 0
.
But e.g. in Linux kernel sources I faced strange declarations dozens of times. e.g. numa_faults_stats
:
enum numa_faults_stats {
NUMA_MEM = 0,
NUMA_CPU,
NUMA_MEMBUF,
NUMA_CPUBUF
};
What is the need for explicitly set first element of this enum to 0
?