From c704824b45731f2400355ebe8ae0c576e19dc072 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 25 Oct 2021 10:49:11 +0200 Subject: osdep: add MP_UNREACHABLE This seems to work on gcc, clang and mingw as-is, but I made it conditional on __GNUC__ just in case, even though I can't figure out which compilers we care about that don't export this define. Also replace all instances of assert(0) in the code by MP_UNREACHABLE(), which is a strict improvement. --- options/m_config_core.c | 2 +- options/parse_configfile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'options') diff --git a/options/m_config_core.c b/options/m_config_core.c index f82b886670..fd476a0627 100644 --- a/options/m_config_core.c +++ b/options/m_config_core.c @@ -879,7 +879,7 @@ void mp_read_option_raw(struct mpv_global *global, const char *name, } } - assert(0); // not found + MP_UNREACHABLE(); // not found } static const struct m_config_group *find_group(struct mpv_global *global, diff --git a/options/parse_configfile.c b/options/parse_configfile.c index 627c466948..1ef256989f 100644 --- a/options/parse_configfile.c +++ b/options/parse_configfile.c @@ -176,7 +176,7 @@ static bstr read_file(struct mp_log *log, const char *filename) } size += s; } - assert(0); + MP_UNREACHABLE(); } // Load options and profiles from from a config file. -- cgit v1.2.3