Subject: Re: bug#15798: Bad variable name "noreturn" in libguile/throw.h

From: Mark H Weaver <[email-masked]>
Date: Mon, 04 Nov 2013 21:47:49 -0500

Jack Howarth <[email-masked]> writes:

> On Mon, Nov 04, 2013 at 07:48:29PM -0500, Mark H Weaver wrote:
>> Matt Sicker <[email-masked]> writes:
>> > In the function scm_ithrow, the parameter "int noreturn" is given. Now
>> > this works fine normally, but if stdnoreturn.h is included before
>> > throw.h (or libguile.h more likely), then this causes a compilation
>> > error. In throw.c, noreturn is even marked as an unused variable, so
>> > this is even more annoying! I recommend using "no_return" to prevent
>> > any namespace conflicts.
>> 
>> Fixed in stable-2.0.  Thanks for the report.
>> 
>> http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commit;h=36c40440078c005cd5e239cca487d29f6f60007d
>> 
>>     Mark
>> 
>> 
>
> What is the motivation to change from attribute (noreturn) to attribute (__noreturn__). Xcode 5.0
> has /Library/Developer/CommandLineTools/usr/lib/clang/5.0/include/stdnoreturn.h with...
>
[...]
>
> #ifndef __STDNORETURN_H
> #define __STDNORETURN_H
>
> #define noreturn _Noreturn
> #define __noreturn_is_defined 1

Yes, and this is a problem.  If this file has been included before
__scm.h, then I expect that __attribute__((noreturn)) will expand to
__attribute__((_Noreturn)) which will most likely fail.  That was the
motivation for this change.

> ps Also see http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15807.

I will respond to that bug report in a separate message.

     Mark