[Mingw-users] Problems with compiling Windows system calls with MinGW gcc 6.3.0

Back to archive index

Keith Marshall keith****@users*****
Thu Aug 2 01:32:16 JST 2018


On 01/08/18 16:47, Eli Zaretskii wrote:
>> From: Keith Marshall <keith****@users*****>
>> Date: Tue, 31 Jul 2018 18:00:37 +0100
>>
>> I just found another ... running mingwrt's C++ headers integrity test
>> fails in <process.h>, because g++ now seems to provide internal
>> prototypes for execv(), execve(), and execvp(), which conflict with the
>> Microsoft specific declarations in <process.h>.
> 
> Ouch!  So another release of MinGW GCC will be needed to fix this?  Or
> is there a way to avoid the problem with some easier solution?

The problem is that Microsoft changed the return type, a few years ago,
from "int", (which is what the rest of the *nix world still uses), to
"intptr_t".  Of course, Microsoft also changed the names, (by adding
their beloved/hideous leading underscore), and their current online
documentation just says that the original POSIX functions are
deprecated, and that one should use their "ISO C++ conformant" functions
instead[*] ... and they don't even bother to show prototypes for the
POSIX functions.

The simplest solution would be to either[**]:

  - remove the offending prototypes from the OLDNAMES section of our
    mingwrt <process.h>, or ...

  - leave the OLDNAMES prototypes in place, but revert the return
    type to "int", (as g++ wants it, and POSIX says it should be).

[*] Actually, I'd advise against using these Microsoft functions anyway;
if they successfully create a child process, then the calling process
terminates, without providing any mechanism for its parent to wait for,
or even identify the child.

[**] There's actually a third option: ignore the testsuite failure!  The
issue isn't even apparent, unless compiling with -Wsystem-headers, (as
the testsuite does), and even then it only raises warnings, (unless
-Werror is also enabled).

-- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
Url : https://lists.osdn.me/mailman/archives/mingw-users/attachments/20180801/3bfd7edd/attachment.pgp 



More information about the MinGW-Users mailing list
Back to archive index