Use __builtin_unreachable() to silent some GCC warnings

This is cleaner than using exit() for that purpose.
kalman-mex
Sébastien Villemot 2023-10-18 14:25:43 -04:00
parent daa6b5569d
commit d78dea3086
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 2 additions and 2 deletions

View File

@ -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