PRB: F3606, F3607 Errors Porting FORTRAN Code From DEC VAX

Last reviewed: December 11, 1995
Article ID: Q49467
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 4.0, 4.01, 4.1, 5.0, 5.1
  • Microsoft FORTRAN for OS/2, versions 4.1, 5.0, 5.1
  • Microsoft FORTRAN PowerStation for MS-DOS, versions 1.0 and 1.0a
  • Microsoft FORTRAN PowerStation 32 for Windows NT, version 1.0 and 4.0

SYMPTOMS

During the process of compiling an application, the compiler generates the following messages:

FORTRAN 5.x

   F3606: formal argument 1 : type mismatch
   F3607: formal argument 1 : length mismatch

FORTRAN PowerStation

   F4016: formal argument 1 : type mismatch
   F4017: formal argument 1 : length mismatch

FORTRAN PowerStation 32, version 4.0

   warning FOR4639: inconsistent data type for argument 1 in call
   to procedure

   warning FOR4227: argument (number 1) in reference to procedure
   from procedure main incorrect: has the wrong data type

CAUSE

In a FORTRAN application developed in the DEC VAX environment, it is not necessary to be consistent when passing actual arguments to a subprogram. However, the Microsoft FORTRAN compiler detects the inconsistency and generates these errors.

RESOLUTION

The errors are recoverable errors; the compiler produces an OBJ file after reporting the errors. You can either choose to ignore the errors or to modify the source code to be consistent when it passes formal arguments.

MORE INFORMATION

The following code example demonstrates this problem.

Sample Code

C Compiler options needed: None

      INTEGER*4 INTX
      LOGICAL*1 LOGIC
      CALL SUB1(LOGIC)
      CALL SUB1(INTX)
      END
C
      SUBROUTINE SUB1(INTY)
      INTEGER*4 INTY
      END

When the compiler processes this code, it reserves 4 bytes for the INTX variable and 1 byte for LOGIC. When it processes the first call to SUB1, it assumes that the formal argument requires only 1 byte. Then, when it processes the second call to SUB1, it determines that the formal argument requires 4 bytes and produces the errors. In this case, both the length and the type of the formal argument changed between calls.


Additional reference words: 4.00 4.01 4.10 5.00 5.10
KBCategory: kbtool kberrmsg kbprb
KBSubcategory: FLIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 11, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.