[fpc-pascal] looks like a bug
P Padil
ppadilcdx at gmail.com
Mon Oct 19 04:55:29 CEST 2026
I typically got an exception even w/o those flags. I might have gotten to complacent running w/o them set though.
> On Oct 18, 2026, at 7:29 PM, cnc at telenet.be wrote:
>
> {$R+} // range checking
> {$Q+} // overflow checking
>
>
>
> ----- Oorspronkelijk bericht -----
> Van: "P Padil via fpc-pascal" <fpc-pascal at lists.freepascal.org>
> Aan: "discussions FPC-Pascal users" <fpc-pascal at lists.freepascal.org>
> Cc: "P Padil" <ppadilcdx at gmail.com>
> Verzonden: Maandag 19 oktober 2026 02:45:30
> Onderwerp: [fpc-pascal] looks like a bug
>
> I set a small array and the program below is ok to go out of bounds.
>
> —
> program test;
>
> type
> tarr = array of array of boolean;
>
> var
> exa : tarr = ((false,false,true,true),(false,false,true,true),
> (true,true,false,true), (true,true,true,false));
>
> begin
> writeln(exa[0,0],', ',exa[4,4]);
> writeln(low(exa),', ',high(exa));
> writeln(low(exa[4]),', ',high(exa[4]));
> end.
> —
> Free Pascal Compiler version 3.2.2 [2024/09/11] for aarch64
> Copyright (c) 1993-2021 by Florian Klaempfl and others
> Target OS: Darwin for AArch64
> Compiling test.pp
> Assembling test
> Linking test
> -macosx_version_min has been renamed to -macos_version_min
> ld: warning: -multiply_defined is obsolete
> 15 lines compiled, 0.3 sec
> FALSE, TRUE
> 0, 3
> 0, 3
>
> Regards
> Pete
> _______________________________________________
> 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