[Bug libfortran/48961] EXECUTE_COMMAND_LINE(WAIT=.false.) fails on MinGW

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat May 14 15:26:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48961

--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-05-14 14:05:19 UTC ---
(In reply to comment #9)
>               execl(<shell path>, "sh", "-c", command, (char *)0);
> where <shell path> is an unspecified pathname for the sh utility."

> Thus, for a POSIX system, one could use:
>   execlp ("sh", "sh", "-c", command, (char*) 0);

Actually, via "confstr(_CS_PATH, buf, sizeof(buf))" one can find the path.
Nevertheless, calling "sh" assumes that one has a POSIX system; I am pretty
sure that it would fail on MinGW - even though, "system()" works there. Maybe,
one can use some configure check to know whether "sh" is available. However,
the check should be cross-compile friendly.



More information about the Gcc-bugs mailing list