This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin's GCC doesn't like this .sa_handler initialization for some reason

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 :-(

  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.


Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]