This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Using chmod fails under MinGW
On Fri, Oct 03, 2008 at 08:28:55AM +0200, Arjen Markus wrote:
> Steve Kargl wrote:
>
> >With _getuid(), gfortran is literally trying to link in a
> >function named _getuid().
> >
> >With __gfortran_chmod_func(), gfortran has essentially implemented
> >the function as (in a psuedo-code)
> >
> > function chmod(yada)
> > call system("chmod yada", status=chmod)
> > return status
> >
> >That is, gfortran assumes you have a standalone program named chmod,
> >and it uses a system() call to execute it. I don't remember if
> >libgfortran's configure has the smarts to disable building chmod().
> >
> >The real solution is to dump Windows and MingW if you want to use
> >all of the nonstandard intrinsic procedures.
> >
>
> I am merely trying to find out what nonstandard intrinsic procedures are
> useful/useable under Windows (either via MinGW or Cygwin), like
> chdir() or rename().
>
> I still think there is a problem with gfortran wrt chmod(): if it uses
> an external utility to do the job, then linking the program should
> work, even if it does not actually change the file permissions
> because there is no such external utility available. It is, however,
> in the link phase that the problem occurs.
>
That's the smart configure problem I'm talking about. When building
libgfortran may detect that the program chmod does not exist, so the
library does not include _gfortran_chmod_func(). The front-end of the
compiler has no knowledge of this missing function and happily
generates a call for the intrinsic function chmod().
--
Steve