The switch will cause compiler warnings when missing enumerators. The array as it was written will produce NULL for missing errors (no out of bounds, because of the MAX + 1 size).
Also, prefixed the errors with CMP_ERROR_ to namespace all the enumerators into the cmp_error_t enum namespace.
The
switch
will cause compiler warnings when missing enumerators. The array as it was written will produceNULL
for missing errors (no out of bounds, because of theMAX + 1
size).Also, prefixed the errors with
CMP_ERROR_
to namespace all the enumerators into thecmp_error_t
enum namespace.