https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62215
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jb at gcc dot gnu.org, | |kargl at gcc dot gnu.org --- Comment #1 from kargl at gcc dot gnu.org --- (In reply to Jeffrey Armstrong from comment #0) > Created attachment 33373 [details] > Patch to delete existing .mod file prior to updating > > Under Win32 using GNU Fortran 4.9.0 or 4.9.1, module files (.mod) are not > updated properly when necessary because the code to do so is simply calling > "rename()" to move the temporary .mod file to the permanent name without > first deleting any existing .mod files. The Windows C runtime states that > this operation will fail if a file of the same target name exists already > (see the "Remarks" section at > http://msdn.microsoft.com/en-us/library/zw5t957f.aspx). > > Versions 4.8 and earlier of GNU Fortran first performed an "unlink()" on the > existing file to delete it, so this bug is new with the 4.9 series. > > I've attached a patch for 4.9.1 that reinstates the unlink operation that > was present in 4.8 and earlier. Looks like Janne removed that chunk of code in r198023. Janne, is there any reason that this cannot be restored? Jeff, Do you have a copyright assignment on file? Although the patch is small and reverts to older code (which means an assignment is most likely not necessary), if you plan to contribute in the future, then having the assignment on file would be nice.