public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Why is popen from stdio.h disabled with -std=c++11?
@ 2017-01-30 16:41 Пётр Б.
  2017-01-30 17:38 ` Yaakov Selkowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Пётр Б. @ 2017-01-30 16:41 UTC (permalink / raw)
  To: cygwin

See usr/include/stdio.h:343 (2016.12.16)

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.
What is the problem and can it be solved?

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

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Why is popen from stdio.h disabled with -std=c++11?
  2017-01-30 16:41 Why is popen from stdio.h disabled with -std=c++11? Пётр Б.
@ 2017-01-30 17:38 ` Yaakov Selkowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Yaakov Selkowitz @ 2017-01-30 17:38 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-30 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-30 16:41 Why is popen from stdio.h disabled with -std=c++11? Пётр Б.
2017-01-30 17:38 ` Yaakov Selkowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).