1 05/31/80 New FORTRAN Differences
2
3 This info segment contains a list of differences between the old
4 and new FORTRAN compilers. Some of these differences require source
5 level changes to maintain program functionality, and others just
6 require recompilation. For a description of how to convert from the
7 old FORTRAN source format to the new, or for a complete list of
8 syntactic differences between the compilers, refer to
9 new_fortran_conversions.gi.info.
10
11
12 1. The new compiler only generates a segdef for the name of the
13 object segment. It does not generate an entry definition with
14 that name unless the source segment contains a subroutine,
15 function, or entry point with that name. The entry point for the
16 main program, if it exists, is main_.
17
18
19 2. The default storage class is automatic instead of static. This
20 can result in program failure if the logic of the program depends
21 on values remaining in storage throughout the life of a run. The
22 automatic or save statement can be used to change the default
23 storage class to static.
24
25 Note -- A simple and efficient way to circumvent this potential
26 problem is to combine all the program units for a particular
27 subsystem into a single source segment. Then, all variables
28 retain their values during the run, and all calls within the
29 subsystem will be intra-segment calls. Intra-segment calls are
30 far more efficient than inter-segment calls.
31
32
33 3. The new compiler does not generate relocation information for an
34 object segment unless the user specifies the -relocation -rlc
35 control argument. The lack of relocation information is only a
36 problem if the user wants to bind the object segment. The
37 Multics binder prevents a user from binding an object segment
38 that does not have relocation information. This difference has
39 been removed. The new compiler now generates relocation
40 information by default. Relocation information may be supressed
41 with the -non_relocatable -nrlc control argument.
42
43 4. The implementation of alternate return statements is
44 incompatible. The user cannot mix old and new object programs
45 that interact via alternate returns.
46
47
48 5. The new compiler does not generate recursive code. Although it
49 is possible to invoke the same program more than once, by using
50 an external call to another segment, a user does so at his own
51 initiative and risk.
52
53 6. If a common block name contains a dollar sign $, a type-4 link
54 is generated. This type of link does not allow for initial
55 values to be provided by data statements. Common block names
56 must be of the form a$b where both a and b are present. If a
57 common block name does not contain a dollar sign, a *system link
58 is generated. This type of link does allow for initial values to
59 be provided by data statements in a block data subprogram. A
60 *system link is generated for blank or unlabelled common,
61 however, the language does not allow this common block to be
62 initalized using data statements. The old compiler always
63 generates type-6 links for common blocks.
64
65
66 7. The semantics of do-loops is incompatible. The new compiler
67 copies the increment and final value before entering the loop.
68 The old compiler does not, allowing them to change during the
69 loop.
70
71 8. The old compiler always generates descriptors for external calls.
72 The new compiler only generates descriptors for external calls if
73 the user declares the external name to require descriptors. The
74 external statement is used:
75
76 external ioa_ descriptors
77
78 The name ioa_ will have descriptors generated for all calls.
79 This declaration also prevents the code generator from checking
80 each argument list for consistency with previous ones.
81
82
83 9. Any do-loop index must be a scalar or subscripted variable.
84 Unsubscripted array names are not allowed. The index of an
85 implied do-loop must be a scalar variable, subscripted variables
86 are not allowed.
87
88 10. The new compiler requires the implicit statement to be the first
89 statement of the program unit not including the subroutine
90 block data or function statement. There can be only one
91 implicit statement per program unit.
92
93 11. A block data subprogram cannot contain executable statements.
94
95
96 12. Parameters that are dimensioned must have parameter or constant
97 extents. The old compiler allows the extents to be in static
98 storage or in common.
99
100 13. Only parameter arrays can have parameter extents. There are no
101 automatic adjustable arrays as is possible with the old
102 compiler.
103
104 14. There is currently no include file processing. This difference
105 has been removed. Include file processing is provided with the
106 %include statement.
107
108
109 15. The number of subscripts specified for array elements of
110 equivalenced data, i, must be 1 or N where N is the actual
111 number of dimensions specified for the array. The old compiler
112 allows 1 <= i <= N.
113
114 16. The assignment of character data constant or variable to real,
115 complex, double precision, and logical variables is not allowed.
116 This difference has been relaxed. Character data may be
117 assigned to integer real double precision or complex
118 variables but not to logical variables.
119
120
121 17. This difference has been removed. The new_fortran compiler now
122 allows the string delimit character within the constant itself.
123 Character strings delimited by a ' cannot include a '. Character
124 strings delimited by a " cannot include a ".
125
126 18. Labeled common blocks cannot be extended beyond the declared
127 size. The old compiler allows this for labeled common as well as
128 unlabeled common.
129
130 19. Data statements for common blocks can only appear in block data
131 subprograms.
132
133 20. Unlabeled common cannot be initialized with data statements.
134
135
136 21. Free-form format is different in the two compilers. The old
137 compiler does not require any explicit continuation character if
138 a statement is continued onto a succeeding line, however, the new
139 compiler does. Refer to new_fortran_conversions.gi.info for a
140 complete description of the syntactic differences between the
141 compilers.
142
143 22. There is no distinction made between uppercase and lowercase
144 characters except in literal constants if the -card or -fold
145 control argument is given.
146
147 23. Runtime formats must be character or integer arrays or character
148 variables. The old compiler allows arrays of any mode.
149
150
151 24. Double precision octal constants octal constants longer than 12
152 digits are not allowed. This difference has been removed.
153 Octal constants as long as 24 digits are allowed for double
154 precision and complex data.
155
156 25. Double precision and complex data is always double-word aligned.
157 The old compiler generates very inefficient code to allow this
158 data to be on an odd word boundary.
159
160 26. This difference has been removed.
161
162 27. This difference has been removed.
163
164
165 28. This difference has been removed.
166
167 29. Newline characters in list-directed input are treated as if they
168 were blanks. The old FORTRAN I/O gave a special meaning to the
169 newline character. A comma followed by a newline denoted a null
170 value in the old system. A blank line also denoted a null value
171 in the old system. In the new FORTRAN I/O both of these are
172 treated as white space. This change also applies to object
173 segments created by the old compiler.
174
175 30. List directed input termination is different. The new runtime
176 accepts either / or ; as an indication of premature end-of-input.
177 If one of these characters is encountered in the input, the rest
178 of the items in the input/output list are not assigned values.
179
180
181 31. The semantics of the endfile statement is different. Until an
182 unspecified time in the future, the endfile statement, when
183 compiled with the new compiler, prints a message at runtime but
184 otherwise has no effect.
185
186 32. The order of precedence of the exponentiation operator is from
187 left to right. The old compiler goes from right to left. This
188 difference has been removed.
189
190 33. Range checking is always performed for computed go to statements.
191 If the value of the expression is out of range, the computed go
192 to statement is ignored and control passes to the next statement.
193 This is also true for an alternate return from a subroutine.
194
195
196 34. Subscript range checking can only be enabled or disabled for
197 subscripted array references. The old compiler also validates
198 computed go to statements and alternate returns from subroutines.
199
200 35. The implied unit read statement uses file 0 instead of file 5.
201
202 36. The print statement uses file 0 instead of file 6.
203
204 37. The -convert control argument to the fortran command is no longer
205 supported. It is not deemed necessary.
206
207 38. The control arguments -symbols and -source are no longer
208 supported. The only listing generating control arguments are
209 -list and -map.