This is a bit strange, but with /undef it fails. The code is:
!ftn95$free
MODULE CPP_SHARED
TYPE CPP_STRUCT_TYPE
INTEGER, POINTER :: CPP_INTEGER => NULL()
REAL, POINTER :: CPP_REAL => NULL()
END TYPE
TYPE(CPP_STRUCT_TYPE), DIMENSION(50,50) :: CPP_STRUCTURE
CONTAINS
SUBROUTINE INITIALISE_CPP_STRUCTURES()
INTEGER IWIN, IFLD
DO IWIN = 1, 50, 1
DO IFLD = 1, 50, 1
CPP_STRUCTURE(IWIN, IFLD)%CPP_INTEGER => NULL()
CPP_STRUCTURE(IWIN, IFLD)%CPP_REAL => NULL()
END DO
END DO
END SUBROUTINE
end module
The error is:
************** Compiling testnull
0017) CPP_STRUCTURE(IWIN, IFLD)%CPP_INTEGER => NULL()
*** Error 1188: This pointer assignment would assign a pointer to the wrong kind of data
0018) CPP_STRUCTURE(IWIN, IFLD)%CPP_REAL => NULL()
*** Error 1188: This pointer assignment would assign a pointer to the wrong kind of data
0017) CPP_STRUCTURE(IWIN, IFLD)%CPP_INTEGER => NULL()
*** Error 250: You cannot assign an expression of type void to a variable of type INTEGER(KIND=3)
*** Error 891: Different types in pointer assignment - the left hand side is INTEGER(KIND=3), yet the right is void
0018) CPP_STRUCTURE(IWIN, IFLD)%CPP_REAL => NULL()
*** Error 250: You cannot assign an expression of type void to a variable of type REAL(KIND=1)
*** Error 891: Different types in pointer assignment - the left hand side is REAL(KIND=1), yet the right is void
6 ERRORS [<INITIALISE_CPP_STRUCTURES> FTN95 v8.51.1]
*** Compilation failed