From 67706c208b2af80e10e52bd0da842c1acb664727 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 23 Aug 2016 09:03:22 -0400 Subject: [PATCH] assert: Use false in asserts rather than 0 Quiets extended warnings. --- src/common/assert.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/assert.h b/src/common/assert.h index dccf053e..077c29e0 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -29,13 +29,13 @@ static void assert_noinline_call(const Fn& fn) { do if (!(_a_)) { assert_noinline_call([] { \ fprintf(stderr, "Assertion Failed!\n" #_a_); \ throw ""; \ - }); } while (0) + }); } while (false) #define ASSERT_MSG(_a_, ...) \ do if (!(_a_)) { assert_noinline_call([&] { \ fprintf(stderr, "Assertion Failed!\n" #_a_ "\n" __VA_ARGS__); \ throw ""; \ - }); } while (0) + }); } while (false) #define UNREACHABLE() ASSERT_MSG(false, "Unreachable code!") #define UNREACHABLE_MSG(...) ASSERT_MSG(false, __VA_ARGS__)