← board

{$Q+} / {$OVERFLOWCHECKS ON}: checked integer arithmetic

Semantics (FPC)

Inside a {$Q+} region, +, -, *, Succ, Pred, Abs and Sqr on integer operands that wrap raise "Runtime error 215" — catchable as EIntOverflow when sysutils is in. {$Q-} (default) keeps today's wrapping behaviour. The check is per OPERATION SITE, lexically scoped by the directive.

Design notes (from tonight's recon)

Acceptance

Log