1.1.52 $Q $OVERFLOWCHECKS: Overow checking

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

Remark:Overow 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 overow in Free Pascal, while in Turbo Pascal they are not.

Using the f$Q-g switch switches o the overow checking code generation.

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