Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

passing optional arguments

$
0
0

I am using Fortran Compiler XE 15.0.1.148 .

When I compile and run the attached program, it crashes with an access violation.  The error occurs when an optional array section, that is not present, is passed to another subroutine.  There are no errors when I compile the same program with gfortran (4.9.1).

I am not sure if the bug is in the Fortran program, or the compiler.  I have checked the standard, and it is not clear if this is allowed.

12.5.2.12 Argument presence and restrictions on arguments not present

3 An optional dummy argument that is not present is subject to the following restrictions.

(1) If it is a data object, it shall not be referenced or be defined. If it is of a type that has default initialization, the initialization has no effect.
...  11 other restrictions.

4 Except as noted in the list above, it may be supplied as an actual argument corresponding to an optional dummy argument, which is then also considered not to be present.

 

Roman

 

AttachmentSize
Downloadtest_optional.f90871 bytes

Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>