Insert not_reached after an exhaustive switch

In the C11 atomics backport, we couldn't use not_reached() in
atomic_enum_to_builtin (in atomic_gcc_atomic.h), since atomic.h was hermetic and
assert.h wasn't; there was a dependency issue.  assert.h is hermetic now, so we
can include it.
This commit is contained in:
David Goldblatt 2017-03-03 16:43:47 -08:00 committed by David Goldblatt
parent e9852b5776
commit 84326c566a

View File

@ -1,6 +1,8 @@
#ifndef JEMALLOC_INTERNAL_ATOMIC_GCC_ATOMIC_H #ifndef JEMALLOC_INTERNAL_ATOMIC_GCC_ATOMIC_H
#define JEMALLOC_INTERNAL_ATOMIC_GCC_ATOMIC_H #define JEMALLOC_INTERNAL_ATOMIC_GCC_ATOMIC_H
#include "jemalloc/internal/assert.h"
#define ATOMIC_INIT(...) {__VA_ARGS__} #define ATOMIC_INIT(...) {__VA_ARGS__}
typedef enum { typedef enum {
@ -25,8 +27,8 @@ atomic_enum_to_builtin(atomic_memory_order_t mo) {
case atomic_memory_order_seq_cst: case atomic_memory_order_seq_cst:
return __ATOMIC_SEQ_CST; return __ATOMIC_SEQ_CST;
} }
/* Can't actually happen; the switch is exhaustive. */ /* Can't happen; the switch is exhaustive. */
return __ATOMIC_SEQ_CST; not_reached();
} }
ATOMIC_INLINE void ATOMIC_INLINE void