bug-gnulib
[Top][All Lists]
Advanced

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

Re: AC_C_NORETURN macro?


From: Vincent Lefevre
Subject: Re: AC_C_NORETURN macro?
Date: Sun, 29 Apr 2012 17:34:49 +0200
User-agent: Mutt/1.5.21-6201-vl-r48020 (2011-12-20)

On 2012-04-29 16:19:35 +0200, Bruno Haible wrote:
> Vincent Lefevre wrote:
> > modules/snippet/_Noreturn references build-aux/snippet/_Noreturn.h,
> > which is:
> > 
> > #ifndef _Noreturn
> > # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
> >       || 0x5110 <= __SUNPRO_C)
> > #  define _Noreturn __attribute__ ((__noreturn__))
> > # elif 1200 <= _MSC_VER
> > #  define _Noreturn __declspec (noreturn)
> > # else
> > #  define _Noreturn
> > # endif
> > #endif
> > 
> > but I don't see how it can be correct on a non-GCC non-SunPro C11
> > implementation: _Noreturn would get defined to nothing; the code
> > would be valid, but the C11 _Noreturn function specifier would not
> > be used.
> 
> If we get to know a different compiler which support _Noreturn but
> does not have a working <stdnoreturn.h> file, we can add it to the
> #ifs here.

But I don't like the fact that you assume by default that compilers
are non-conforming. However the C committed is partly in fault by not
providing a macro (e.g. __STDC_NORETURN__) to check whether _Noreturn
is supported with a #if (for the C99 -> C11 transition).

-- 
Vincent Lefèvre <address@hidden> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



reply via email to

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