Hello, When libgfortran is configured w/ HAVE_WORKING_STAT undefined *and* current system is not MinGW - FIND_FILE_[DECL|ARGS} still trying to use Windows's handles (id).
Proposed patch discriminates MinGW case under HAVE_WORKING_STAT switched off. Bootstrapped (on Linux). libgfortran/ * io/unix.c (FIND_FILE0_DECL): Don't use `id' when HAVE_WORKING_STAT is not defined and system is not MinGW. (FIND_FILE0_ARGS): Ditto. Is it ok for trunk? Is it ok for gcc-5-branch? (if bootstrap passed) -- Thanks, K $ git show c1d01f74051f65e75b0de73b1b43c76b9b2e1b02 commit c1d01f74051f65e75b0de73b1b43c76b9b2e1b02 Author: Kirill Yukhin <kirill.yuk...@intel.com> Date: Fri Sep 18 19:00:52 2015 +0300 Fix libgfortran/io/unix.c to allow not stable STAT for non MinGW. diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index b86bd67..772725a 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -1551,8 +1551,13 @@ compare_file_filename (gfc_unit *u, const char *name, int len) # define FIND_FILE0_DECL struct stat *st # define FIND_FILE0_ARGS st #else -# define FIND_FILE0_DECL uint64_t id, const char *path -# define FIND_FILE0_ARGS id, path +# if defined(__MINGW32__) +# define FIND_FILE0_DECL uint64_t id, const char *path +# define FIND_FILE0_ARGS id, path +# else +# define FIND_FILE0_DECL const char *path +# define FIND_FILE0_ARGS path +# endif #endif /* find_file0()-- Recursive work function for find_file() */