https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65200
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jvdelisle at gcc dot gnu.org --- Comment #2 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- >From PR65203 Thomas comment: Currently, when encountering EACCES or EROFS upon opening, we fall back towards opening the file read-only. This is a) not documented b) surprising for some users (an inconsistency has been commented upon) c) causes inconsistencies with NFS v4, which appears to return EPERM for a read-only file for no reason that I can see. The original report can be found at http://stackoverflow.com/questions/28696539/fortran-open-call-differs-on-nfsv3-vs-nfsv4 . My suggestion would be to a) document and c) extend the behavior to EPERM.