delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/26/12:45:22

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4BD5C311.2060708@redhat.com>
Date: Mon, 26 Apr 2010 10:45:05 -0600
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4
MIME-Version: 1.0
To: cygwin <cygwin AT cygwin DOT com>
Subject: Re: Cygwin's GCC doesn't like this .sa_handler initialization for some reason
References: <20100425113232 DOT GA11541 AT sbox>
In-Reply-To: <20100425113232.GA11541@sbox>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------enig40D6C9853008B8827E6A8AF8
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

[this was originally raised on the libvirt list]

On 04/25/2010 05:32 AM, Matthias Bolte wrote:
> +    struct sigaction action_stop;
>=20=20
> -    struct sigaction action_stop =3D {
> -        .sa_handler =3D stop
> -    };
> +    memset(&action_stop, 0, sizeof action_stop);
> +
> +    action_stop.sa_handler =3D 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?

--=20
Eric Blake   eblake AT redhat DOT com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig40D6C9853008B8827E6A8AF8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJL1cMRAAoJEKeha0olJ0NqgksH/0eeGbb43PSsjq7joV/EZ4kZ
4gCA9K+RHaRreDGqas8OJDORglMyT41TjgdmeKz7b6EL/tom+Ml3H6hni98+m8cb
RenrPmoZDmXfZ/WVSycPut2rbmrWFnTT1rrE2IpDBPls3fxnZtYjVix4cjxa2X0X
DvOH+MD0rWbR8ds4+F2W40uQeDx43W0AKx+bEiRqu9IBeTu+mBeDwrkK3zaT270v
7f/Yii8T2hlw4GR3tqlRddZKC6mFwPgtWJrH22pB/aZuOAv3eBaM11GnsAL9sjEu
7GeAr4BP3LMQt1e+bita82AuI066Ykp6YHP7cbtB4pLDUhv1pxC+z43isaAlIqk=
=nRB6
-----END PGP SIGNATURE-----

--------------enig40D6C9853008B8827E6A8AF8--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019