Fortran-Specific Analysis

The source checker is able to detect issues with the following:

The following example illustrates Fortran-specific analysis.

Example 1: Undefined function result

File f1.f contains the following lines:

1 subroutine foo(m)

2 integer, dimension(2,3) :: m

3 do i=1,3

4 print *,m(:,i)

5 end do

6 end

7 integer, dimension(3,2) :: n

8 do i=1,2

9 n(:,i) = i

10 end do

11 call foo(n)

12 ! shapes of argument #1 and dummy argument are different.

13 do i=1,2

14 print *,n(:,i)

15 end do

16 end

Source code analysis issues the following message:

f1.f(11): error #12028: shape of actual argument 1 in call of "FOO" doesn't match the shape of formal argument "M"; "FOO" is defined