public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: stdnoreturn: fix for Cygwin
       [not found] <4260817.MvLg4Vb6y4@omega>
@ 2017-08-17  1:00 ` Eric Blake
  2017-08-17  1:55   ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Blake @ 2017-08-17  1:00 UTC (permalink / raw)
  To: Bruno Haible, bug-gnulib, The Cygwin Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 1275 bytes --]

Adding cygwin list...

On 08/16/2017 07:01 PM, Bruno Haible wrote:
> On Cygwin 1.7.30, I'm seeing this testdir build failure, when compiling
> test-stdnoreturn.c:
> 
> /usr/include/stdlib.h:66:28: error: expected ‘,’ or ‘;’ before ‘)’ token
>  _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));

> +
> +   Similarly, on Cygwin, standard include files contain declarations like
> +     void __cdecl abort (void) __attribute__ ((noreturn));
> +   "#define noreturn _Noreturn" would cause this declaration to be rewritten
> +   to the invalid
> +     void __cdecl abort (void) __attribute__ ((__attribute__ ((__noreturn__))));

Hmm. It's evil for any system .h file to ever use
__attribute__((barename)), since barename is in the user's namespace and
can therefore be defined to anything else, possibly breaking the header
(as you just proved).  Hopefully, the problem goes away if cygwin
patches its headers to use __attribute__((__noreturn__)), so that gnulib
can then define noreturn at will.

I'll look into patching Cygwin to fix all barename attributes I can find
that should be __barename__ instead.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: stdnoreturn: fix for Cygwin
  2017-08-17  1:00 ` stdnoreturn: fix for Cygwin Eric Blake
@ 2017-08-17  1:55   ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2017-08-17  1:55 UTC (permalink / raw)
  To: Bruno Haible, bug-gnulib, The Cygwin Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 1627 bytes --]

On 08/16/2017 07:59 PM, Eric Blake wrote:
> Adding cygwin list...
> 
> On 08/16/2017 07:01 PM, Bruno Haible wrote:
>> On Cygwin 1.7.30, I'm seeing this testdir build failure, when compiling
>> test-stdnoreturn.c:
>>
>> /usr/include/stdlib.h:66:28: error: expected ‘,’ or ‘;’ before ‘)’ token
>>  _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
> 
>> +
>> +   Similarly, on Cygwin, standard include files contain declarations like
>> +     void __cdecl abort (void) __attribute__ ((noreturn));
>> +   "#define noreturn _Noreturn" would cause this declaration to be rewritten
>> +   to the invalid
>> +     void __cdecl abort (void) __attribute__ ((__attribute__ ((__noreturn__))));
> 
> Hmm. It's evil for any system .h file to ever use
> __attribute__((barename)), since barename is in the user's namespace and
> can therefore be defined to anything else, possibly breaking the header
> (as you just proved).  Hopefully, the problem goes away if cygwin
> patches its headers to use __attribute__((__noreturn__)), so that gnulib
> can then define noreturn at will.
> 
> I'll look into patching Cygwin to fix all barename attributes I can find
> that should be __barename__ instead.

On a closer look, I've already done this, several years ago (although a
few more have crept in since then):
https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=commitdiff;h=ada456dcf

Bruno, your cygwin installation of 1.7.30 is old, compared to current 2.8.2

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-17  1:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4260817.MvLg4Vb6y4@omega>
2017-08-17  1:00 ` stdnoreturn: fix for Cygwin Eric Blake
2017-08-17  1:55   ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).