public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/14959] New: [gfortran] (G95) not recognizing internal file in PURE/ELEMENATAL function
@ 2004-04-14 23:25 jtk at ou dot edu
  2004-04-14 23:28 ` [Bug fortran/14959] [gfortran] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jtk at ou dot edu @ 2004-04-14 23:25 UTC (permalink / raw)
  To: gcc-bugs

The compiler is not recognizing the internal file when in a PURE/ELEMENTAL
function.  Removing PURE/ELEMENTAL removes the error, but breaks subsequent
code.



Code:

   ELEMENTAL FUNCTION FMT_GN(N)
!  "Gn" IO Format Specifier  
   USE CHAR_UTIL, ONLY: STRIP
   INTEGER(I4B),    INTENT(IN) :: N
   CHARACTER(LEN=12)           :: FMT_GN
!  Calling Sequence:
!  N       Width of Field
!  FMT_GN  Format character string
!
   INTEGER(I4B)     :: N2
   CHARACTER(LEN=4) :: C_NUM, C_NUM2
   INTEGER          :: IOS
!
   N2 = N - 7
   WRITE(C_NUM ,'(I4)',IOSTAT=IOS) N
   WRITE(C_NUM2,'(I4)',IOSTAT=IOS) N2
   FMT_GN = '(1PG'//STRIP(C_NUM)//'.'//STRIP(C_NUM2)//')'
!
   END FUNCTION FMT_GN



Error:

tmp/g95/bin/i686-pc-linux-gnu-g95 -g  -c FG_Text_File.f90
In file FG_Text_File.f90:874
                                                                                
   WRITE(C_NUM ,'(I4)',IOSTAT=IOS) N
                                   1
Error: io-unit in WRITE statement at (1) must be an internal file in a PURE
procedure
In file FG_Text_File.f90:875
                                                                                
   WRITE(C_NUM2,'(I4)',IOSTAT=IOS) N2
                                    1
Error: io-unit in WRITE statement at (1) must be an internal file in a PURE
procedure
make: *** [FG_Text_File.o] Error 1

-- 
           Summary: [gfortran] (G95) not recognizing internal file in
                    PURE/ELEMENATAL function
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jtk at ou dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-07-09 23:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-14 23:25 [Bug fortran/14959] New: [gfortran] (G95) not recognizing internal file in PURE/ELEMENATAL function jtk at ou dot edu
2004-04-14 23:28 ` [Bug fortran/14959] [gfortran] " pinskia at gcc dot gnu dot org
2004-04-30 15:00 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2004-05-13 11:06 ` pinskia at gcc dot gnu dot org
2004-05-13 11:50 ` tobi at gcc dot gnu dot org
2004-05-13 11:52 ` jtk at octopus dot scif dot ou dot edu
2004-07-09 23:02 ` [Bug fortran/14959] " Tobias dot Schlueter at physik dot uni-muenchen dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).