[fpc-pascal] What is -CO ?

Michalis Kamburelis michalis.kambi at gmail.com
Fri Jun 9 12:42:59 CEST 2023


I'm also curious :)

I just tested, and the -Co (lowercase "o") enables overflow checking
by default (like "{$Q+}" in code),
https://github.com/michaliskambi/modern-pascal-introduction/wiki/What-are-range-and-overflow-checks-(and-errors)-in-Pascal
.

But -CO (uppercase "O") seems unrelated to it.

This example:

"""
{$mode objfpc}
uses SysUtils;
var
  A: Int64;
begin
  A := High(Int64) - 100;
  A := A + 200;
  Writeln('Result is ', A);
end.
"""

... behaves the same, regardless if it's compiled with "-CO" or not.
(Only "-Co" is relevant, controls do we make overflow check, as
expected.)

Regards,
Michalis

pt., 9 cze 2023 o 12:03 Mattias Gaertner via fpc-pascal
<fpc-pascal at lists.freepascal.org> napisał(a):
>
> Hi,
>
> What is -CO?
>
> In the docs I can only find this sentence:
> "Check for possible overflow of integer operations"
>
>
> Mattias
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


More information about the fpc-pascal mailing list