Fix a compiler complaint

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-02-18 21:08:21 +00:00
parent 2a41847aa6
commit bb8fd08b5b
2 changed files with 14 additions and 4 deletions

View File

@ -9,6 +9,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include "compiler.h"
@ -29,6 +30,13 @@ safe_isnan(double a) {
return isnan(a);
}
/// Same as assert false, but make sure we abort _even in release builds_.
/// Silence compiler warning caused by release builds making some code paths reachable.
attr_noret static inline void BUG(void) {
assert(false);
abort();
}
/**
* Normalize an int value to a specific range.
*