From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48586 invoked by alias); 11 Nov 2016 05:01:25 -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 48576 invoked by uid 89); 11 Nov 2016 05:01:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1500 X-HELO: mail-it0-f43.google.com Received: from mail-it0-f43.google.com (HELO mail-it0-f43.google.com) (209.85.214.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Nov 2016 05:01:23 +0000 Received: by mail-it0-f43.google.com with SMTP id e187so58264601itc.0 for ; Thu, 10 Nov 2016 21:01:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=RJTE1CBOw6oqt2+QxeYiaw3Cb4yChonTa0nhGWt1ijc=; b=U46mKpUM7S/IMZ+9UNSwK4FFYjNWWZ6YHKRA8VTjDTZddrfsTdXgmfxsXvPA/axEZu nYuw/qUm052aKaY98h1j06ywgQR1GiVaOEGW18o68oquw4Qx8cYurwYpw5K2Ydn/EWyu 5iGaeQ1AZGNEuhGep2a7a2Wqu8TOQt18dExtk+i29q8CAOnSrr4EcJ6lUFs0LoWJ36iL ZPSzCiAnNjHRI1zfZSLj0Qf0v8u8vS3qxmKWfWA6mVAe/8ipDN1fb0tQDQNmWEwKMvbR QK0g065AZXxKPOXSy9hsgkzTwHK67m8LnrqmZ3cZw32GQkRt6dCIf008dBaq2dhIaatW 0XAg== X-Gm-Message-State: ABUngvedIZJ98Term83OQaJdnzxyejzeJRgQxXuAPBEK4B11WIYZ6mBv8UQzIW2UFfHAoA== X-Received: by 10.36.69.155 with SMTP id c27mr20061691itd.1.1478840481129; Thu, 10 Nov 2016 21:01:21 -0800 (PST) Received: from [192.168.0.6] (d27-96-48-76.nap.wideopenwest.com. [96.27.76.48]) by smtp.gmail.com with ESMTPSA id l62sm3338061itc.12.2016.11.10.21.01.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 21:01:20 -0800 (PST) Subject: Re: issetugid - not declared when _XOPEN_SOURCE is also defined To: cygwin@cygwin.com References: <9bb90c12-b50b-faf9-b309-f916dd84bebe@gmail.com> <20161110091010.GB6075@calimero.vinschen.de> From: cyg Simple Message-ID: Date: Fri, 11 Nov 2016 07:31:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161110091010.GB6075@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00110.txt.bz2 On 11/10/2016 4:10 AM, Corinna Vinschen wrote: > 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? >>> >>> /*****************************************************/ >>> #define _XOPEN_SOURCE 1 /* Causes declare warning */ >>> #define __BSD_VISIBLE 1 >>> #include >>> >>> int main(int argc, char ** argv) { >>> int result; >>> result = issetugid(); >>> } >>> /****************************************************/ >>> >> >> 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. >> >> 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. Yea, I figured that out. I used __BSD_VISIBLE after looking at the header for the function. Thanks for your time; sorry for wasting it. -- cyg Simple -- 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