Forum > Free Pascal

FPC 3.2.x series branched, trunk update to 3.3.1

<< < (2/41) > >>

JuhaManninen:

--- Quote from: valdir.marcos on September 17, 2018, 07:27:17 am ---I am confused.
Which one is most probably to be released: Lazarus 2.0.0 with FPC 3.0.4 or FPC 3.2.0?

--- End quote ---
You asked the same question in another thread. I don't know why you are confused.

valdir.marcos:

--- Quote from: JuhaManninen on September 17, 2018, 11:18:41 am ---
--- Quote from: valdir.marcos on September 17, 2018, 07:27:38 am ---I am confused.
Which one is most probably to be released: Lazarus 2.0.0 with FPC 3.0.4 or FPC 3.2.0?
--- End quote ---
With FPC 3.0.4 obviously. FPC 3.2.0 will not be released for a long time. There is even no RC1 yet.
--- End quote ---


--- Quote from: Martin_fr on September 17, 2018, 11:47:02 am ---That said, testing with 3.2 branch is still recommended too, since once 3.2 is out the next minor (Lazarus 2.0.x) will probably use it.
--- End quote ---


--- Quote from: JuhaManninen on September 17, 2018, 11:23:40 am ---
--- Quote from: valdir.marcos on September 17, 2018, 07:27:17 am ---I am confused.
Which one is most probably to be released: Lazarus 2.0.0 with FPC 3.0.4 or FPC 3.2.0?
--- End quote ---
You asked the same question in another thread. I don't know why you are confused.
--- End quote ---
Sorry for duplicating my post.
Thanks.

zamtmn:
Blaazen

--- Quote ---gives no warning at 3.0.4 but with the latest trunk it gives
"unit1.pas(36,14) Warning: Local variable "a" of a managed type does not seem to be initialized" at line with SetLength, which is silly since SetLength itself is initialization. SetLength passes
--- End quote ---
Yes I am also interested, will it be fixed?

Thaddy:
No. If you followed the bug report on Mantis.
Case in point is that setlength() does NOT guarantee its values are initialized to a default. It just reserves space for a given number of elements. Even if the compiler MAY internally do something more.
As explained in the bug report and the follow ups it is trivial to actually initialize. (different syntax for objfpc and delphi mode, beware)
And as far as I can see there is no need for a fix.

mse:

--- Quote from: Blaazen on August 19, 2018, 12:21:23 am ---
--- Quote ---the moment to test the compatibility of your codebases with the future FPC is _NOW_!
--- End quote ---
This code

--- 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";}};} ---procedure TForm1.Button1Click(Sender: TObject);var a: array of Integer;    i: Integer;begin  SetLength(a, 10);  //HERE  for i:=0 to length(a)-1 do    a[i]:=i;end;gives no warning at 3.0.4 but with the latest trunk it gives
"unit1.pas(36,14) Warning: Local variable "a" of a managed type does not seem to be initialized" at line with SetLength, which is silly since SetLength itself is initialization. SetLength passes parameter by refrence (var) but it is same in 3.0.4 and 3.1.1.

--- End quote ---
In MSEgui I use

--- 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";}};} ---{$ifndef mse_allwarnings} {$if fpc_fullversion >= 030100}  {$warn 5089 off}  {$warn 5090 off}  {$warn 5093 off}  {$warn 6058 off} {$endif}{$endif} in oder to suppress the unwanted warnings. Problem is that it does not work with -B, see
https://bugs.freepascal.org/view.php?id=34349
I agree that the warnings are wrong or at least sub optimal. Initializing the managed variables in code produces quite heavy redundant instructions:

--- 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";}};} ---procedure test();var s1: string; ar1: integerarty; //=array of integerbegin setlength(s1,10); setlength(ar1,11);end; MAIN_$$_TEST:.Lc1:.Ll1:        leaq    -120(%rsp),%rsp.Lc3:.Ll2:        movq    $0,(%rsp)        movq    $0,8(%rsp)        leaq    16(%rsp),%rdx        leaq    40(%rsp),%rsi        movl    $1,%edi        call    fpc_pushexceptaddr        movq    %rax,%rdi        call    fpc_setjmp        movslq  %eax,%rdx        movq    %rdx,104(%rsp)        testl   %eax,%eax        jne     .Lj6.Ll3:        movq    %rsp,%rdi        xorl    %edx,%edx        movl    $10,%esi        call    fpc_ansistr_setlength.Ll4:        movq    $11,112(%rsp)        movq    $RTTI_$MSETYPES_$$_INTEGERARTY,%rsi        leaq    112(%rsp),%rcx        leaq    8(%rsp),%rdi        movl    $1,%edx        call    fpc_dynarray_setlength 
--- 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";}};} ---procedure test();var s1: string = ''; ar1: integerarty = nil; //=array of integerbegin setlength(s1,10); setlength(ar1,11);end; MAIN_$$_TEST:.Lc1:.Ll1:        leaq    -120(%rsp),%rsp.Lc3:.Ll2:        movq    $0,(%rsp)        movq    $0,8(%rsp)        leaq    16(%rsp),%rdx        leaq    40(%rsp),%rsi        movl    $1,%edi        call    fpc_pushexceptaddr        movq    %rax,%rdi        call    fpc_setjmp        movslq  %eax,%rdx        movq    %rdx,104(%rsp)        testl   %eax,%eax        jne     .Lj6.Ll3:        movq    $RTTI_$MSETYPES_$$_INTEGERARTY,%rdx ----redundant        movq    TC_$MAIN$_$TEST_$$_defaultar1,%rsi        leaq    8(%rsp),%rdi        call    fpc_dynarray_assign        movq    TC_$MAIN$_$TEST_$$_defaults1,%rsi        movq    %rsp,%rdi        call    fpc_ansistr_assign                  ----redundant.Ll4:        movq    %rsp,%rdi        xorl    %edx,%edx        movl    $10,%esi        call    fpc_ansistr_setlength.Ll5:        movq    $11,112(%rsp)        movq    $RTTI_$MSETYPES_$$_INTEGERARTY,%rsi        leaq    112(%rsp),%rcx        leaq    8(%rsp),%rdi        movl    $1,%edx        call    fpc_dynarray_setlength 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version