The following code snippet illustrates my immediate problem.
If I compile with /DEBUG, all the implicit pointers are NULLified when the program loads, as per design intent of line 3. So no need for the executable statements.
If I compile with /CHECKMATE, on the other hand, the compiler generates error 1188 - This pointer assignment would assign a pointer to the wrong kind of data, in respect of the second commented line. If I comment out the executable statements, the implicit pointers are NULLified anyway
The only reason the executable statements are there at all is that without them, in my real code, the implicit pointers are NOT NULLified when I compile with /CHECKMATE. So I put those lines in, and now I can't compile at all. Bit of a Catch 22 ... 😄
So I can't build my real code with /CHECKMATE to diagnose why it isn't working until I can figure out the answer to this sub-problem. Help, please!
<edit 1> On a hunch, I tried sticking the type definitions inside a separate module, but it didn't 'help'; I can comment out the executable lines and the pointers are still NULLified as they should be, whether I use /DEBUG or /CHECKMATE. </edit 1>
Andy
program pointery
type p_rgbtree
type (rgbtree), pointer :: next => null ()
end type p_rgbtree
type rgbtree
type (p_rgbtree) :: ubernode
type (p_rgbtree) :: node (2)
end type rgbtree
type (rgbtree), target :: rgbinfo
integer nod
rgbinfo% ubernode% next => null ()
do nod = 1, 2
rgbinfo% node (nod)% next => null () ! error 1188 here
end do
end program pointery