$Q $OVERFLOWCHECKS: Overflow checking

The {$Q+} or {$OVERFLOWCHECKS ON} directive turns on integer overflow checking. This means that the compiler inserts code to check for overflow when doing computations with integers. When an overflow occurs, the run-time library will print a message Overflow at xxx, and exit the program with exit code 215.

Remark:Overflow checking behaviour is not the same as in Turbo Pascal since all arithmetic operations are done via 32-bit or 64-bit values. Furthermore, the Inc() and Dec standard system procedures are checked for overflow in Free Pascal, while in Turbo Pascal they are not. Using the {$Q-} switch switches off the overflow checking code generation.

The generation of overflow checking code can also be controlled using the -Co command line compiler option (see Users guide).