The selection of the -CA compile-time option has the following effect on the runtime checking of pointers:
The association status of a pointer is checked whenever it is referenced. Error 460 as described in Runtime Errors will be reported at runtime if the pointer is disassociated: that is, if the pointer is nullified, de-allocated, or it is a pointer assigned to a disassociated pointer.
The compile-time option combination of -CA and -CU also generates code to test whether a pointer is in the initially undefined state, that is, if it has never been associated or disassociated or allocated. If a pointer is initially undefined then Error 461 as described in Runtime Errors will be reported at runtime if an attempt is made to use it. No test is made for dangling pointers (that is, pointers referencing memory locations which are no longer valid).
The association status of pointers is not tested when the Fortran standard does not require the pointer to be associated, that is, in the following circumstances:
- in a pointer assignment
- as an argument to the associated intrinsic
- as an argument to the present intrinsic
- in the nullify statement
- as an actual argument associated with a formal argument which has the pointer attribute
The selection of the -CA compile-time option causes code to be generated to test the allocation status of an allocatable array whenever it is referenced, except when it is an argument to the allocated intrinsic function. Error 459 as described in Runtime Errors will be reported at runtime if an error is detected.
The -CA option causes a validation check to be made, on entry to a procedure, on the definition status of an assumed-shape array. Error 462 as described in Runtime Errors will be reported at runtime if the array is disassociated or not allocated.
The compile-time option combination of -CA and -CU will additionally generate code to test whether, on entry to a procedure, the array is in the initially undefined state. If so, Error 463 as described in Runtime Errors.