A null value is passed to a non-optional dummy argument at a FORTRAN subroutine call.
When a call is compiled, an interface may be available that indicates that the called routine expects optional parameters. If the number of actual arguments is less than the number of dummy arguments, then the compiler will pass null opposite the dummy arguments. If it turns out that the actual definition of the called procedure doesn't match the interface, then this convention could cause a null value to be passed opposite a non-optional dummy argument. This usually leads to a null pointer dereference error.
ID |
Observation |
Description |
---|---|---|
1 |
Definition |
The place the function was defined |
2 |
Call site |
The place the function was called |
subroutine mysub(j) integer :: j print *,j end interface subroutine mysub(j) integer, optional :: j end subroutine mysub end interface integer :: m read *, m call mysub(m) call mysub() ! error here: interface says argument is optional when it isn't end
Copyright © 2010, Intel Corporation. All rights reserved.