guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: There is no returning


From: Paul Eggert
Subject: Re: There is no returning
Date: Thu, 14 Nov 2013 15:53:44 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]