FIX: Access Violation with Pass by Value and -Ox -G3

Last reviewed: September 18, 1997
Article ID: Q112011
1.00 WINDOWS NT kbtool kbfixlist

The information in this article applies to:

  • Microsoft FORTRAN PowerStation for Windows NT, version 1.0

SYMPTOMS

Using FORTRAN PowerStation for Windows NT to compile subprograms that pass arguments by value (either by using [C] or [VALUE]) may produce an "access violation" application error message box when compiling with both -G3 and - Ox.

CAUSE

This compile-time error appears to be caused by either passing mismatched arguments by value, or by passing expressions by value in the argument list.

RESOLUTION

When using -G3 and -Ox and passing by value, always match argument lengths and types and do not pass expressions.

STATUS

Microsoft has confirmed this to be a problem in Microsoft FORTRAN PowerStation for Windows NT, version 1.0. This problem was corrected in FORTRAN PowerStation 32, version 4.0.

MORE INFORMATION

The following sample passes expressions by value, and will cause the compiler to generate an access violation when compiling with -G3 -Ox:

Sample Code

c Compile options needed: -G3 -Ox c

        subroutine s[c](rr,r4,r8,rt,rs)
        real*8 r8
        write(*,*) rr, r4, r8, rt,rs
        end

        real*8 r8 /0.d0/
        r4 = 0.
        rr = 0.
        rs = 0.
        rt = 0.
        call s(rr, r4,     r8,     rt, rs)
        call s(rr, r4+1.0, r8-1.0, rt, rs)
        end


Additional reference words: 1.00 Dr. Watson
KBCategory: kbtool kbbuglist kbfixlist
KBSubcategory: FL32Iss
Keywords : FL32Iss kbbuglist kbfixlist kbtool
Version : 1.00
Platform : NT WINDOWS
Solution Type : kbfix


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: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.