By default, pointer arithmetic is enabled in FPC/OBJFPC modes and disabled in DELPHI mode. The directive $POINTERMATH ON/OFF can be used to toggle pointer arithmetic support. Types declared while $POINTERMATH ON is in effect also support pointer arithmetic.
This boolean directive enables or disables the use of pointer arithmetic in expressions involving pointers. When enabled, the difference of 2 pointers is a valid integer expression, and an integer value can be added to a pointer value.
The following
{$POINTERMATH OFF} unit MyUnit;
tells the compiler to give an error whenever pointer math appears in an expression.