In libgfortran/intrinsics/stat.c, we unconditionally issue calls to stat(),
fstat() and lstat(). This is wrong, and these calls should be protected by
HAVE_{,F,L}STAT macros, themselves defined by autoconf.

This bug is annoying especially for lstat(), because it's non-POSIX and it's
not present on mingw; this, in turns, prevent us from creating a DLL
libgfortran (when the recent libtool patch by Steve Ellcey will be commited, it
will be the only bug still preventing this!). In the lstat() case, when lstat()
is not available and stat() is available, we should use it instead.

PS: We already have a test HAVE_WORKING_STAT that is used by the I/O system to
see if the system stat implementation fits the needs of the I/O code, but this
is unrelated.


-- 
           Summary: Calls lstat(), stat() and fstat() in libgfortran should
                    be protected by autoconf HAVE_{L,,F}STAT macros
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: fxcoudert at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31335

Reply via email to