Adde helper for unreachable code paths

This commit is contained in:
Henrik Stickann 2022-04-15 14:58:24 +02:00
parent 073fe83e7e
commit de4f610843

View File

@ -34,4 +34,16 @@
#endif // STA_BKPT
// TODO Check for GCC
/**
* @brief Helper for silencing compiler warnings in unreachable code locations.
*
* Example: Default of switch handling all cases of enum class
*/
#ifndef STA_UNREACHABLE
# define STA_UNREACHABLE() __builtin_unreachable()
#endif // STA_UNREACHABLE
#endif // STA_LANG_HPP