delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/01/12/13:13:25

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Define _POSIX_SOURCE in cygwin's features.h?
Date: Thu, 12 Jan 2006 18:13:16 -0000
MIME-Version: 1.0
In-Reply-To: <20060112175908.GB30108@trixie.casa.cgf.cx>
Message-ID: <SERRANO1aNEVJpjc0D5000000c4@SERRANO.CAM.ARTIMI.COM>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

Christopher Faylor wrote:
> On Thu, Jan 12, 2006 at 05:40:35PM -0000, Dave Korn wrote:
>> Christopher Faylor wrote:
>>> Someone on the cygwin irc channel had a problem building a package
>>> which would have been solved if Cygwin defined _POSIX_SOURCE.
>>> 
>>> I know that Cygwin is not fully POSIX compliant (I really really do)
>>> but I'm wondering if setting _POSIX_SOURCE in the cygwin headers
>>> wouldn't solve more porting problems than it creates.

>> As far as I can tell by googling, _POSIX_SOURCE, despite the leading
>> underscore, is in fact a user-land feature test macro that it is up to
>> each individual application to decide whether to switch it on or not
>> according to whether the application itself is compliant or not.
> 
> No need to use google.  Just grep for it in /usr/include on linux.

  Um, I know all about the -A/-B/-C switches that get grep to show you the
context around the search match, but I don't know what option switch you pass
to grep to get  it to show you the semantic meaning of the matched text....

> _POSIX_SOURCE is defined in features.h on linux under control of the
> _GNU_SOURCE macro.
>
>   /* If _GNU_SOURCE was defined by the user, turn on all the other
>   features.  */ #ifdef _GNU_SOURCE

... which is equally something that belongs to and is under control of the
user's application, and is a way for the user's application to specify (to the
compiler, C runtime, and whoever else) that it's compliant and requires/copes
with POSIX compliant source in the system header files.

> So, let me clarify.  Should we define _POSIX_SOURCE similarly to the way
> that linux does it?  This may mean that we have to define _GNU_SOURCE
> also and maybe that's not a good idea but, again, it might solve more
> problems than it causes.

  I think it means that whoever you were talking to in the IRC channel should
have defined _POSIX_SOURCE in their application, and the bug is that they
didn't when they should have.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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