Forum > Free Pascal

FPC 3.2.0 Released !

<< < (17/17)

PascalDragon:

--- Quote from: Seenkao on November 28, 2020, 04:35:36 pm ---I hope I have detailed enough?
--- End quote ---

I still had to guess quite a bit. A simple program I can stuff into the compiler is quite essential! Nevertheless I came up with the following:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program trangeerr; {$mode delphi} const  EDIT_TRUE     = $FFFFFFFFF;         // <--- typo (I did it on purpose) var  EditMode : LongWord;                   //  Byte or Word - ignored if not more LongWord const  ACTIVE = 2; type  TEdit = record    Flags: LongWord;  end; procedure Test;const  EditOne = 1;var  newEdit: array[0..1] of TEdit;begin  //if not (EditMode and EDIT_TRUE) = 0 then  begin    EditMode := EditMode or EDIT_TRUE;                          // <-- work!!! always    EditMode := EditMode or $100000000;                      // <-- when debugging is enabled, the dimension                            // checking code is inserted next                            // and even if the program was working, it will not work when debugging                            // (overflow enabled)    newEdit[EditOne].Flags := newEdit[EditOne].Flags or ACTIVE;  end;end; begin  Test;end.
When compiled without -Cr no error will happen, but if compiled with -Cr there'll be a runtime error at line 27 as it should be.

It is right that the compiler currently does not complain at compile time, because it can't. Once the compiler does the EditMode or EDIT_TRUE operation (which will result in a value of native width, in the case of a 64-bit target indeed a 64-bit value) it no longer knows that a constant was involved and thus it can't generate an error at compile time when that value is assigned to EditMode. And EditMode or EDIT_TRUE is a valid expression even if EDIT_TRUE is larger than the size of EditMode.

Seenkao:

--- Quote from: Seenkao on November 28, 2020, 04:35:36 pm ---P.S. in the structure the bytes will be checked for dimension.

--- End quote ---

--- Quote from: PascalDragon on November 28, 2020, 05:31:00 pm ---It is right that the compiler currently does not complain at compile time, because it can't. Once the compiler does the EditMode or EDIT_TRUE operation (which will result in a value of native width, in the case of a 64-bit target indeed a 64-bit value) it no longer knows that a constant was involved and thus it can't generate an error at compile time when that value is assigned to EditMode. And EditMode or EDIT_TRUE is a valid expression even if EDIT_TRUE is larger than the size of EditMode.

--- End quote ---

Понятно, байты проверяет и этого достаточно... Всего доброго!

Igor Kokarev:

--- Quote from: PascalDragon on November 28, 2020, 03:49:21 pm ---

--- Quote from: Igor Kokarev on November 28, 2020, 01:11:28 pm ---When do you plan RC or final version for FPC 3.2.1?

--- End quote ---

We are currently in the progress of merging fixes and improvements from trunk, so it will still take some time. Maybe before Christmas, but don't take that for granted.

--- End quote ---

Thanks! This release is very important, because it officially supports target aarch64-darwin

I'm having problem with using compiled FPC 3.2.1 fixes. So I hope that a package will correctly install FPC 3.2.1 on my Intel Mac.

mrblack:
Hello folks! I'd like to use free pascal with visual studio code, and i'm wondering, how to set ptop formatter with it? I can't find an executable. Thanks for the help. Pascal rules!

UPD
apt show fp-utils-3.0.4

Navigation

[0] Message Index

[*] Previous page

Go to full version