[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MinGW and "warning: implicit declaration of function _spawnv"

From: Bob Friesenhahn
Subject: Re: MinGW and "warning: implicit declaration of function _spawnv"
Date: Tue, 14 Nov 2017 15:50:36 -0600 (CST)
User-agent: Alpine 2.20 (GSO 67 2015-01-07)

On Tue, 14 Nov 2017, Jeffrey Walton wrote:

What does spawnv have to do with _XOPEN_SOURCE?  Isn't spawnv a Microsoft
Windows-specific function and _XOPEN_SOURCE is a Unix thing?

I think spawn is Posix, and its for systems that don't have fork.
posix_spawn and _spawn are deprecated on MS platforms. They use an ISO
C++ version called spawnl. Also see

I was not aware of that.

Its been my experience that when something Posix goes missing when
using Newlib the first thing to try is _XOPEN_SOURCE=500 or
_XOPEN_SOURCE=600. _XOPEN_SOURCE sets _POSIX_SOURCE and a couple of
others, like some X11 defines.

The problem with _XOPEN_SOURCE and _POSIX_SOURCE is that in addition to enabling features, they also disable all the features which are not defined by that standard. If the OS does not support the requested version, then none of the expected features are available. Usually there is a better way.

Regardless, Windows only conformed to the 1989 version of POSIX so that they could say that Windows NT was compliant with the specification so that they could sell it into goverment contracts.

Bob Friesenhahn
GraphicsMagick Maintainer,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]