Mark H Weaver wrote: > Looking at C11, it appears that _Noreturn belongs before the function > return type, whereas __attribute__ (__noreturn__) and SCM_NORETURN goes > after the formal parameter list. So I don't see how your proposed > workaround can work properly.
__attribute__ (__noreturn__) can be at the start of a declaration. So, for example, Gnulib does this, and it seems to work well in practice: #if ! (defined _Noreturn \ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ || 0x5110 <= __SUNPRO_C) # define _Noreturn __attribute__ ((__noreturn__)) # elif defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn # endif #endif