* I cannot understand popen/_popen absence
@ 2017-01-29 0:50 Пётр Б.
2017-01-29 1:16 ` Пётр Б.
0 siblings, 1 reply; 4+ messages in thread
From: Пётр Б. @ 2017-01-29 0:50 UTC (permalink / raw)
To: cygwin
tchar.h: http://pastebin.com/raw/109n342z
So I only get popen if _POSIX_ is defined (which is not defined in any
header, I searched Cygwin folder with file manager).
stdio.h: http://pastebin.com/raw/jrd2dmzP
So I only get popen if some conditions which I did not hear about are
fullfilled. So, what sorcery should I use to get popen?
--
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] 4+ messages in thread
* Re: I cannot understand popen/_popen absence
2017-01-29 0:50 I cannot understand popen/_popen absence Пётр Б.
@ 2017-01-29 1:16 ` Пётр Б.
2017-01-29 4:23 ` Brian Inglis
2017-01-29 12:13 ` Hans-Bernhard Bröker
0 siblings, 2 replies; 4+ messages in thread
From: Пётр Б. @ 2017-01-29 1:16 UTC (permalink / raw)
To: cygwin
Excuse me for vague wording, let me explain it.
I am trying to build Qt under Cygwin. For some mysterious reason
Cygwin compiler does not expose popen with std=c++11 which is required
for Qt
BUT
at the same time the MinGW compiler installed from Cygwin repository
does expose popen with same standard flag.
I did not yet find a convenient way of using MinGW compiler (which is
prefixed) so I am stuggling to get popen exposed.
What is the reason for this difference between MinGW and Cygwin?
2017-01-29 3:50 GMT+03:00, Пётр Б. <satnatantas@gmail.com>:
> tchar.h: http://pastebin.com/raw/109n342z
>
> So I only get popen if _POSIX_ is defined (which is not defined in any
> header, I searched Cygwin folder with file manager).
>
> stdio.h: http://pastebin.com/raw/jrd2dmzP
>
> So I only get popen if some conditions which I did not hear about are
> fullfilled. So, what sorcery should I use to get popen?
>
--
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] 4+ messages in thread
* Re: I cannot understand popen/_popen absence
2017-01-29 1:16 ` Пётр Б.
@ 2017-01-29 4:23 ` Brian Inglis
2017-01-29 12:13 ` Hans-Bernhard Bröker
1 sibling, 0 replies; 4+ messages in thread
From: Brian Inglis @ 2017-01-29 4:23 UTC (permalink / raw)
To: cygwin
On 2017-01-28 18:16, ÐÑÑÑ Ð. wrote:
> Excuse me for vague wording, let me explain it.
> I am trying to build Qt under Cygwin. For some mysterious reason
> Cygwin compiler does not expose popen with std=c++11 which is
> required for Qt
> BUT
> at the same time the MinGW compiler installed from Cygwin repository
> does expose popen with same standard flag.
> I did not yet find a convenient way of using MinGW compiler (which
> is prefixed) so I am stuggling to get popen exposed.
> What is the reason for this difference between MinGW and Cygwin?
Different default options selected during build.
> 2017-01-29 3:50 GMT+03:00, ÐÑÑÑ Ð. <satnatantas@gmail.com>:
>> tchar.h: http://pastebin.com/raw/109n342z
>> So I only get popen if _POSIX_ is defined (which is not defined in
>> any header, I searched Cygwin folder with file manager).
>> stdio.h: http://pastebin.com/raw/jrd2dmzP
>> So I only get popen if some conditions which I did not hear about
>> are fullfilled. So, what sorcery should I use to get popen?
$ fgrep popen -C2 /usr/include/stdio.h
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 199209
int _EXFUN(pclose, (FILE *));
FILE * _EXFUN(popen, (const char *, const char *));
#endif
$ egrep -B1 '#define\s+__(MISC_VISIBLE\s+1|POSIX_VISIBLE\s+199209)' /usr/include/sys/features.h
#ifdef _DEFAULT_SOURCE
#define __MISC_VISIBLE 1
--
#elif (_POSIX_C_SOURCE - 0) >= 2 || defined(_XOPEN_SOURCE)
#define __POSIX_VISIBLE 199209
So you have to #define _DEFAULT_SOURCE 1, _XOPEN_SOURCE 1, or
_POSIX_C_SOURCE 2: some of these may be enabled by using
-std=gnu++1[14yz] instead of -std=c++...;
roughly speaking the latter enables only ISO/IEC 9899:yyyy
standard features and disables POSIX-only features, which
are enabled by using -std=gnu++...
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
--
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] 4+ messages in thread
* Re: I cannot understand popen/_popen absence
2017-01-29 1:16 ` Пётр Б.
2017-01-29 4:23 ` Brian Inglis
@ 2017-01-29 12:13 ` Hans-Bernhard Bröker
1 sibling, 0 replies; 4+ messages in thread
From: Hans-Bernhard Bröker @ 2017-01-29 12:13 UTC (permalink / raw)
To: cygwin
Am 29.01.2017 um 02:16 schrieb ÐÑÑÑ Ð.:
> I am trying to build Qt under Cygwin.
What keeps you from using the existing build? Or from at least looking
at its source package to see how it was managed?
> For some mysterious reason
> Cygwin compiler does not expose popen with std=c++11 which is required
> for Qt
I rather much doubt that this particular setting is required. Nor is
there much mystery about this: std=c++11 is an option that explicitly
requires the compiler to disable _all_ extensions beyond ISO standard
C++. popen is part of the POSIX extensions, so it will be disabled.
> BUT
> at the same time the MinGW compiler installed from Cygwin repository
> does expose popen with same standard flag.
That might be a bug in MinGW, but more likely you overlooked another
flag that re-enabled some extensions.
--
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] 4+ messages in thread
end of thread, other threads:[~2017-01-29 12:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-29 0:50 I cannot understand popen/_popen absence Пётр Б.
2017-01-29 1:16 ` Пётр Б.
2017-01-29 4:23 ` Brian Inglis
2017-01-29 12:13 ` Hans-Bernhard Bröker
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).