File: initializers.fcx

package info (click to toggle)
ftnchek 3.3.1-4
  • links: PTS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 8,488 kB
  • ctags: 5,960
  • sloc: ansic: 21,908; fortran: 5,748; yacc: 4,071; sh: 3,035; makefile: 895; lisp: 322; f90: 118; perl: 76
file content (206 lines) | stat: -rw-r--r-- 7,554 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206

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