From c2c6fc9cd48b59b5d332409580bb3f939049b939 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 3 Jun 2019 06:59:31 -0700 Subject: [PATCH] Work around ClangTidy bug: it wrongly reports that assert(false) should be replaced by static_assert(false, ""). PiperOrigin-RevId: 251222995 --- tensorflow/lite/kernels/op_macros.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tensorflow/lite/kernels/op_macros.h b/tensorflow/lite/kernels/op_macros.h index 1a54a378b03..b1d8059c51c 100644 --- a/tensorflow/lite/kernels/op_macros.h +++ b/tensorflow/lite/kernels/op_macros.h @@ -45,9 +45,14 @@ inline void InfiniteLoop() { fprintf(stderr, "%s", (x)); \ } while (0) -#define TFLITE_ASSERT_FALSE assert(false) #define TFLITE_ABORT abort() +#ifdef NDEBUG +#define TFLITE_ASSERT_FALSE (static_cast(0)) +#else +#define TFLITE_ASSERT_FALSE TFLITE_ABORT +#endif + #endif // TF_LITE_MCU_DEBUG_LOG #define TF_LITE_FATAL(msg) \