Microsoft KB Archive/50589

Incorrect Namelist Specifier in READ Statement Hangs Machine PSS ID Number: Q50589 Article last modified on 05-01-1994

5.00 | 5.00

MS-DOS | OS/2

= SYMPTOMS =

If multiple subroutines that use NAMELISTs are present in the same source file and the NAMELIST group specifier is also present, the Microsoft FORTRAN version 5.0 compiler may hang.

= CAUSE =

The compiler hangs if the NAMELIST group specifier, which is used as a parameter for the READ statement, is used in more than one subroutine within a program, and the NAMELIST group specifier is misspelled in the second or greater subroutine.

= RESOLUTION =

This problem is corrected by an application note titled “FORTRAN 5.0 F1.EXE and F1L.EXE Structure Patch.” This application note is available from Microsoft Product Support Services.

NOTE: This file has been removed from the Software Library but can be requested by calling Microsoft Product Support Services.

Sample Code #1
c the following code illustrates the problem: call sub1(fname) call sub2(fname) end C subroutine sub1(fname) namelist/input/list1 OPEN(UNIT=7,FILE=FNAME) READ(7,NML=INPUT) CLOSE(7) end C subroutine sub2(fname) namelist/input/list2 OPEN(UNIT=7,FILE=FNAME) READ(7,NML=TINPUT) CLOSE(7) end

Notice that in the second subroutine, the NML specifier in the READ statement is misspelled as TINPUT, not the correct namelist name of INPUT. The compiler hangs, although it should catch this as an “F2743 error NML=: not a namelist group name.”

Additional reference words: 5.00 KBCategory: Prg KBSubCategory:

=
================================================================

Copyright Microsoft Corporation 1994.