From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69207 invoked by alias); 10 Nov 2016 09:10:20 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 69173 invoked by uid 89); 10 Nov 2016 09:10:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-101.5 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*MI:sk:9bb90c1, H*i:sk:9bb90c1, H*f:sk:9bb90c1, H*R:D*cygwin.com X-HELO: drew.franken.de Received: from mail-n.franken.de (HELO drew.franken.de) (193.175.24.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Nov 2016 09:10:15 +0000 Received: from aqua.hirmke.de (aquarius.franken.de [193.175.24.89]) (Authenticated sender: aquarius) by mail-n.franken.de (Postfix) with ESMTPSA id 31D68721E2822 for ; Thu, 10 Nov 2016 10:10:11 +0100 (CET) Received: from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6]) by aqua.hirmke.de (Postfix) with ESMTP id 9285A5E01E6 for ; Thu, 10 Nov 2016 10:10:10 +0100 (CET) Received: by calimero.vinschen.de (Postfix, from userid 500) id 81CDDA804C1; Thu, 10 Nov 2016 10:10:10 +0100 (CET) Date: Thu, 10 Nov 2016 09:10:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: issetugid - not declared when _XOPEN_SOURCE is also defined Message-ID: <20161110091010.GB6075@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <9bb90c12-b50b-faf9-b309-f916dd84bebe@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline In-Reply-To: <9bb90c12-b50b-faf9-b309-f916dd84bebe@gmail.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-SW-Source: 2016-11/txt/msg00086.txt.bz2 --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1399 On Nov 9 14:41, cyg Simple wrote: > On 11/9/2016 1:13 PM, cyg Simple wrote: > > The following program demonstrates the issue. Should issetugid be > > declared with this scenario? > >=20 > > /*****************************************************/ > > #define _XOPEN_SOURCE 1 /* Causes declare warning */ > > #define __BSD_VISIBLE 1 > > #include > >=20 > > int main(int argc, char ** argv) { > > int result; > > result =3D issetugid(); > > } > > /****************************************************/ > >=20 >=20 > Because when _XOPEN_SOURCE is 1 _DEFAULT_SOURCE doesn't get set which > then #undef __BSD_VISIBLE and and sets it to 0. See > /usr/include/sys/features.h. >=20 > If I #define _DEFAULT_SOURCE 1 before the #include then the above code > works. However, should it? Yes. You have a bug in your code. Never (and I mean *never*) use the __foo_VISIBLE macros in your code. Please read the long comment preceeding the visibility macro handling in /usr/include/sys/features.h. You want to use either _DEFAULT_SOURCE or _BSD_SOURCE (deprecated but probably available for another 100 years). Also, note the description of the __foo_VISIBLE macros later in the file. It introduces the macros as "private" macros. HTH, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYJDlyAAoJEPU2Bp2uRE+gsAoP/2hpgaqtUVHwUQfc8e+0XtuR Bv5Gf5q4lmdl/oghzOVP+tmVWdH5Ei/Td7O9duZNoijv9VwHpG0pJgTZl5o7mJo5 kVa+sfkQHL1sknGVxQkMqUtrVTk/Ffyc8mE0bb/1vCcDcwgX7m2HUndnpfHs2K1V HADtnb0y7GuiG20oiYlnqEgJY/EOGM22RMsH2jeSAkdseGsM6pHFHE/ivfXRMP3E 4Ip13stIAtyABHBYAI+94dLgTTleRSC4ZH2M42rSIehUwllgumyR4ykJGrcuIMQp OOv74Hh3Tnmzj9iFw9DH5FXhP5hDao4lkA6z7AG8/HawW4hqHc5xTZUsS6/MDx5B MBooM/viMdifCx5Oj0+J8VdMxbHRxp8YI5LBb+cJFUZxlZXKlkZGX/HlTkO3P+FF BsvampSQEIuKqDCh0JGd1hou1rkLAfaVgZseE2fiu27tIbuv4aPnGkRkMTAMLFtl caNZuxpN7FnettpZzyDMHL2kn5mFFHsTs9tCgh0oF6GeT1D6nlQ751Tdq03hgJHY 62wOcolyN+dYTc3nNYOycxzOBmuMOr/4fhhHvr56QvNgcaq8cy4A+jpmFPOUccdg sFR5dX7GuHPE3wQO7BFDzenOdLbPLNQDIRAhSct3dOQDWyqO1EE74u71h5+MQadQ 3Xt6UGDAaRdcwYs97g0D =bNxA -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip--