[PATCH] Fortran: Fix directory stat check for '.' [PR103560]

Tobias Burnus tobias@codesourcery.com
Wed Mar 23 13:55:04 GMT 2022


As reported in the PR103560. The patch is a slightly modified version
of the patch proposed by the bug reporter (with pseudonym?) Carlos Une.

The problem seems to be that 'stat ("./", ...)' fails with MinGW while
'stat (".", ...)' works. Besides, I think it makes sense to defer the
usage of '/' until needed - and I believe the error messages also make
more sense now.

Due to diagnostic changes in GCC 12, this pre-exising old issue was
exposed and shows up as bootstrap fail in GCC 12.

I intent to commit it later today (to GCC 12, only),
unless someone suggests a change.

Tobias

PS: I was briefly considering to use DIR_SEPARATOR (as defined in system.h),
but that one is '/' (while DIR_SEPARATOR_2 is '\\', if defined). Thus, it
does not seem to be worthwhile - especially as '/' needs to be converted to
"/" for strcat - or
   fullname[strlen(path)] = DIR_SEPARATOR; fullname[strlen(path)+1]='\0';
has to be used.
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fortran-Fix-directory-stat-check-for-.-PR103560.patch
Type: text/x-patch
Size: 5147 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20220323/8b3b8c21/attachment.bin>


More information about the Fortran mailing list