
FTNCHEK Version 3.3 November 2004

File initializers.f:

      1 C  Testing syntax recognition and assignment type checking of
      2 C  standard and non-standard initializing declarations.
      3 
      4 C  Here we use modern standard F90 initializers
      5       subroutine f90
      6       integer :: m, n = 100
                              ^
"initializers.f", line 6 col 23: Warning: Nonstandard syntax: F90-style
 initializer
                      ^
"initializers.f", line 6 col 15: Warning: Nonstandard syntax: attribute-based
 variable declaration
      7 C ftnchek does not recognize the following one yet
      8       integer, dimension(5) :: a = (/ 1, 2, 3, 4, 5 /)
                                              ^
"initializers.f", line 8 col 39: Error: syntax error, unexpected '/'
      9       real :: pi = 3.14159265358979d0
                         ^
"initializers.f", line 9 col 18: Warning: Nonstandard syntax: F90-style
 initializer
                           ^
"initializers.f", line 9 col 20: Warning: dble const 3.14159265358979D0 
 truncated to real PI
                   ^
"initializers.f", line 9 col 12: Warning: Nonstandard syntax: attribute-based
 variable declaration
     10       character :: c = 32   ! type mismatch
                                    ^
"initializers.f", line 10 col 29: Warning: Nonstandard syntax: inline comment
                             ^
"initializers.f", line 10 col 22: Warning: Nonstandard syntax: F90-style
 initializer
                               ^
"initializers.f", line 10 col 24: Error: type mismatch: intg const 32 assigned
 to char*1 C
                        ^
"initializers.f", line 10 col 17: Warning: Nonstandard syntax: attribute-based
 variable declaration
     11       integer :: q = 'hello'   ! type mismatch
                                       ^
"initializers.f", line 11 col 32: Warning: Nonstandard syntax: inline comment
                           ^
"initializers.f", line 11 col 20: Warning: Nonstandard syntax: F90-style
 initializer
                             ^
"initializers.f", line 11 col 22: Error: type mismatch: char*5 const 'hello' 
 assigned to intg Q
                      ^
"initializers.f", line 11 col 15: Warning: Nonstandard syntax: attribute-based
 variable declaration
     12       print *, 'F90 initializers:'
     13       print *, m, n, a   ! m used before set
                                 ^
"initializers.f", line 13 col 26: Warning: Nonstandard syntax: inline comment
     14       print *, pi, c, q
     15       end

Module F90: subr

Variables:
 
      Name Type Dims     Name Type Dims     Name Type Dims     Name Type Dims
         A intg  1          C char             M intg             N intg   
        PI real             Q intg   



"initializers.f", line 13: Warning in module F90: Variables used before set
"initializers.f", line 13:     A used; never set
"initializers.f", line 13:     M used; never set

I/O Operations:

     Unit ID Unit No. Access Form Operation   Line
           *            SEQ  FMTD PRINT        12     13     14 
     16 C  Here we use archaic but standard F77 separate type decls and data stmts
     17       subroutine f77
     18       integer m, n, a(5)
     19       real pi
     20       character c
     21       integer q
     22       data n / 100 /
     23       data a /  1, 2, 3, 4, 5 /
     24       data pi / 3.14159265358979d0 /
     25       data c / 32 /   ! type mismatch
                              ^
"initializers.f", line 25 col 23: Warning: Nonstandard syntax: inline comment
     26       data q / 'hello' /   ! type mismatch
                                   ^
"initializers.f", line 26 col 28: Warning: Nonstandard syntax: inline comment
     27       print *, 'F77 initializers:'
     28       print *, m, n, a   ! m used before set
                                 ^
"initializers.f", line 28 col 26: Warning: Nonstandard syntax: inline comment
     29       print *, pi, c, q
     30       end

Module F77: subr

Variables:
 
      Name Type Dims     Name Type Dims     Name Type Dims     Name Type Dims
         A intg  1          C char             M intg             N intg   
        PI real             Q intg   



"initializers.f", line 28: Warning in module F77: Variables used before set
"initializers.f", line 28:     M used; never set

I/O Operations:

     Unit ID Unit No. Access Form Operation   Line
           *            SEQ  FMTD PRINT        27     28     29 
     31 C  This one uses "bastard" initializer form.
     32       subroutine bastard
     33       integer m, n / 100 /, a(5) / 1, 2, 3, 4, 5 /
                           ^
"initializers.f", line 33 col 20: Warning: Nonstandard syntax: combined type
 declaration and data-style initializer
                                         ^
"initializers.f", line 33 col 34: Warning: Nonstandard syntax: combined type
 declaration and data-style initializer
     34       real pi / 3.14159265358979d0 /
                      ^
"initializers.f", line 34 col 15: Warning: Nonstandard syntax: combined type
 declaration and data-style initializer
                        ^
"initializers.f", line 34 col 17: Warning: dble expr 3.14159265358979D0 
 truncated to real PI
     35       character c / 32 /   ! type mismatch
                                   ^
"initializers.f", line 35 col 28: Warning: Nonstandard syntax: inline comment
                          ^
"initializers.f", line 35 col 19: Warning: Nonstandard syntax: combined type
 declaration and data-style initializer
                            ^
"initializers.f", line 35 col 21: Error: type mismatch: intg expr 32 assigned to 
 char*1 C
     36       integer q / 'hello' /   ! type mismatch
                                      ^
"initializers.f", line 36 col 31: Warning: Nonstandard syntax: inline comment
                        ^
"initializers.f", line 36 col 17: Warning: Nonstandard syntax: combined type
 declaration and data-style initializer
                          ^
"initializers.f", line 36 col 19: Error: type mismatch: char expr 'hello 
 assigned to intg Q
     37       print *, 'bastard initializers:'
     38       print *, m, n, a   ! m used before set
                                 ^
"initializers.f", line 38 col 26: Warning: Nonstandard syntax: inline comment
     39       print *, pi, c, q
     40       end

Module BASTARD: subr

Variables:
 
      Name Type Dims     Name Type Dims     Name Type Dims     Name Type Dims
         A intg  1          C char             M intg             N intg   
        PI real             Q intg   



"initializers.f", line 38: Warning in module BASTARD: Variables used before
 set
"initializers.f", line 38:     M used; never set


"initializers.f", line 32: Warning in module BASTARD: Names longer than 6
 chars (nonstandard):
"initializers.f", line 32:     BASTARD declared
I/O Operations:

     Unit ID Unit No. Access Form Operation   Line
           *            SEQ  FMTD PRINT        37     38     39 
     41 C  Main program just suppresses "never invoked" warnings.
     42       program main
     43       call f90
     44       call f77
     45       call bastard
     46       end
     47 

Module MAIN: prog

External subprograms referenced:

   BASTARD: subr          F77: subr          F90: subr   




"initializers.f", line 45: Warning in module MAIN: Names longer than 6 chars
 (nonstandard):
"initializers.f", line 45:     BASTARD referenced

 5 syntax errors detected in file initializers.f
 29 warnings issued in file initializers.f

