This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: issetugid - not declared when _XOPEN_SOURCE is also defined
- From: cyg Simple <cygsimple at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 9 Nov 2016 14:41:04 -0500
- Subject: Re: issetugid - not declared when _XOPEN_SOURCE is also defined
- Authentication-results: sourceware.org; auth=none
- References: <d61199c7-85d2-039d-58cb-29fb8d6ff369@gmail.com>
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 <unistd.h>
>
> 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?
--
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