delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/01/30/12:38:43

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=Fl8qYJp1LdW5ajTu
akLgJNnssxepSZ5LgwlNhQ1lIJFyx+sDtaDQQFJF6ajJnyhmBEjWR323WViDxMYd
WlrbUklxhFPoMmJC2XBtYvJyPSLjVaSP8ualDFjKtc27r2SdsTHFVMr2ZZJA1Da6
mVmwh31NixFmdU1s7uGiuHy14GU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=2O/jVdOXSYD8Cx8k0WsNxx
HyXYo=; b=h0U6aNzRD5cBlayAHDlda6jAhrXPGvcTnjWnyxohLQYqVhBAcL5pMH
ZHNaQgcBs3JsBr1mClrF3OmUETnj16HwyFaBQ7FNtvu+kKFmCnmfgs7rYn5cbE0b
A00L6f7wpKeQQ7InGkrsaRZN07KzRXk0AqJJz2Cu+9mrrcvpHdhAY=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=2.5 required=5.0 tests=AWL,BAYES_00,BODY_8BITS,GARBLED_BODY,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=H*M:cygwin, H*f:sk:Ni7jPd8, H*i:sk:Ni7jPd8, H*F:D*cygwin.com
X-HELO: mx1.redhat.com
Subject: Re: Why is popen from stdio.h disabled with -std=c++11?
To: cygwin AT cygwin DOT com
References: <CA+Ni7jPd8kpSJgM2DGoMvuUpQL9Kf-vxyyw_6yQiqig5-s6hfw AT mail DOT gmail DOT com>
From: Yaakov Selkowitz <yselkowitz AT cygwin DOT com>
Message-ID: <cb06911b-93e1-dadf-1b55-0c94955bc0ff@cygwin.com>
Date: Mon, 30 Jan 2017 11:38:25 -0600
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
MIME-Version: 1.0
In-Reply-To: <CA+Ni7jPd8kpSJgM2DGoMvuUpQL9Kf-vxyyw_6yQiqig5-s6hfw@mail.gmail.com>
X-IsSubscribed: yes
Note-from-DJ: This may be spam

On 2017-01-30 10:41, Пётр Б. wrote:
> Why is popen from stdio.h disabled with -std=c++11? I am trying to
> grasp it and I can't.
>
> It is exposed if -std=c11 but not for c++11.

No, it's not, you get an implicit function declaration warning in C. 
C++ is simply less forgiving (which is not a bad thing in this case).

> What is the problem and can it be solved?

Use -std=gnu++11, or -D_DEFAULT_SOURCE with -std=c++11.

> Why does -std=c++11 prevent POSIX visibility?

Because it means ISO standard C++, which popen is not.

> MinGW exposes popen as _popen, could it be an option for Cygwin?

Absolutely not, that is an MSVC-ism.

-- 
Yaakov

--
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

- Raw text -


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