https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66936
Bug ID: 66936 Summary: io/unix.c gratuitously uses S_IRWXG and S_IRWXO on the basis that mkstemp() is available Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran Assignee: unassigned at gcc dot gnu.org Reporter: keith.marshall at mailinator dot com Target Milestone: --- Created attachment 36013 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36013&action=edit Kludge to work around issue for mingw32 When building GCC, with FORTRAN language support, for mingw32 with the mingwrt-3.21+ runtime library from MinGW.org installed, the build fails in libgfortran/io/unix.c, because the tempfile_open() function gratuitously assumes that, if HAVE_MKSTEMP is defined, then it must invoke: mode_mask = umask (S_IXUSR | S_IRWXG | S_IRWXO); regardless of whether or not those access mode flags are defined. Of course, the assumption is invalid: while S_IXUSR may have some semblance of meaning on a windows host, and is defined, S_IRWXG and S_IRWXO are meaningless, and are not. Now, I can kludge around this, with the attached patch, but I suspect that it doesn't represent a true solution.