This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin's GCC doesn't like this .sa_handler initialization for some reason
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 26 Apr 2010 19:54:29 +0100
- Subject: Re: Cygwin's GCC doesn't like this .sa_handler initialization for some reason
- References: <20100425113232.GA11541@sbox> <4BD5C311.2060708@redhat.com>
On 26/04/2010 17:45, Eric Blake wrote:
> [this was originally raised on the libvirt list]
>
> On 04/25/2010 05:32 AM, Matthias Bolte wrote:
>> + struct sigaction action_stop;
>>
>> - struct sigaction action_stop = {
>> - .sa_handler = stop
>> - };
>> + memset(&action_stop, 0, sizeof action_stop);
>> +
>> + action_stop.sa_handler = stop;
>
> This is because on Linux, sa_handler is a macro that expands into an
> access of a named member of a named union, whereas on cygwin, sa_handler
> is a directly named member of an anonymous union. Is this a gcc bug, or
> should we be changing cygwin/signal.h to follow Linux' lead of using
> macros to access named unions to allow source compatibility, since gcc
> falls flat at performing named initialization of a member of gcc's
> extension of an anonymous union?
This is the long-standing PR10676 :-(
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676
Given the rate of progress so far, I reckon we should adopt Linux'
workaround. Hopefully we'll be able to take it back out again someday.
cheers,
DaveK
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple