https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62215
--- Comment #5 from Jeffrey Armstrong <jeffrey.armstrong at approximatrix dot com> --- While checking for MinGW (or MinGW-W64) (or non-POSIX Cygwin if it's a thing...) would allow this to be fixed for Windows, it would continue to assume that any other C runtime would have a POSIX-compliant "rename()" function. I would think that could be dangerous. That said, I can't think of another C runtime that doesn't provide a POSIX-compliant "rename()" function other than some versions of the OpenWatcom C runtime (I'm pretty sure you guys don't care about that) and any MS-DOS or OS/2 C runtimes. Is there a big cost or danger to "unlink()" the existing file first? POSIX "rename()" is going to do that anyway; my patch (and GNU Fortran < 4.9) simply does the deleting explicitly.