https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114309
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Also this works just fine to disable the warning around the unlikely: #define push_warning _Pragma("GCC diagnostic push") #define pop_warning _Pragma("GCC diagnostic pop") #define disable_warning _Pragma("GCC diagnostic ignored \"-Wattributes\"") #define barf(msg) do { push_warning disable_warning [[unlikely]] crash(msg); pop_warning } while(0)