You need to show the EXACT error message, and investigate PRECISELY where in the statement to problem is.
the EXACT error message is in the title of the thread. As far the "PRECISELY" goes, there is only one place where a conversion from pointer to ordinal occurs, that settles the precision concern.
Your use of ptruint(SomePointer) suggests that ptruint is happy casting a pointer.
No, on the contrary, the message "suggests" it is not happy at all about that.
But in your second ptruint() the parameter is zero, and my suspicion is that internally it's casting this to nil before applying the explicit cast.
IF the compiler is internally casting the zero to nil then it is hallucinating because there is no reason to cast the zero to nil and then cast that back to ptruint. The compiler is most definitely _not_ doing that.
So what the compiler's objecting to is your implicit conversion between zero and nil, not your explicit casts.
No, it is not complaining about that and there is no implicit conversion of zero to nil in that statement. That statement, unnecessarily, casts zero to ptruint (which causes no harm and is totally superfluous.) If you need to convince yourself, remove the ptruint cast of zero and you'll see the same "hint" come up.
{$APPTYPE CONSOLE}
program ConversionHint;
var
Somepointer : pointer;
begin
SomePointer := @Somepointer; { remove "doesn't seem to be initialized..." }
if ptruint(SomePointer) = ptruint(0) then
end.