From d78dea308637b6b65acd669871c8bb02996d3344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Wed, 18 Oct 2023 14:25:43 -0400 Subject: [PATCH] Use __builtin_unreachable() to silent some GCC warnings This is cleaner than using exit() for that purpose. --- mex/sources/bytecode/BasicSymbolTable.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mex/sources/bytecode/BasicSymbolTable.cc b/mex/sources/bytecode/BasicSymbolTable.cc index 623bdca1ec..c41f98a62d 100644 --- a/mex/sources/bytecode/BasicSymbolTable.cc +++ b/mex/sources/bytecode/BasicSymbolTable.cc @@ -75,7 +75,7 @@ BasicSymbolTable::getName(SymbolType type, int tsid) const { mexErrMsgTxt(("Unknown symbol with ID " + to_string(tsid) + " and type " + to_string(static_cast<int>(type))).c_str()); } - exit(EXIT_FAILURE); // Silence GCC warning + __builtin_unreachable(); // Silence GCC warning } pair<SymbolType, int> @@ -89,7 +89,7 @@ BasicSymbolTable::getIDAndType(const string &name) const { mexErrMsgTxt(("Unknown symbol: " + name).c_str()); } - exit(EXIT_FAILURE); // Silence GCC warning + __builtin_unreachable(); // Silence GCC warning } size_t -- GitLab