Re: [fpc-pascal] how to convert this to mode objfpc

2015-05-11 Thread misu kun
thanks so much Sven , ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] how to convert this to mode objfpc

2015-05-11 Thread misu kun
thanks in objfpc mode i can imagine this ,but it didn't work unless i specialize (obj) type generic obj = object x : T; end; operator + (arg1 ,arg2 : obj):obj; // error : here (obj) needs specialization begin result.x := arg1.x + arg2.x; end; _

[fpc-pascal] how to convert this to mode objfpc

2015-05-11 Thread misu kun
Hi what is the equivalence of this code using mode objfpc ? btw , it compile fine with {$mode delphi} type obj = object x : T; class operator add (arg1 ,arg2 : obj):obj; inline; end; class operator obj.add (arg1 ,arg2 : obj):obj; begin

Re: [fpc-pascal] why fpc do not use a known return function value

2015-02-03 Thread misu kun
> mind sharing the C code? int c ; int test( int p){ int i; i = p; return (i+2+c+2+c+2+c); } int main(){ c = test(128); } ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] why fpc do not use a known return function value

2015-02-03 Thread misu kun
i mean even if you initilize c with a const value. i enabled {$optimization constprop} but nothing changed ! 2015-02-03 11:19 UTC+01:00, misu kun : > thanks , > even if you remove c and call test() inside writeln for example, > still the s

Re: [fpc-pascal] why fpc do not use a known return function value

2015-02-03 Thread misu kun
thanks , even if you remove c and call test() inside writeln for example, still the same thing . ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] why fpc do not use a known return function value

2015-02-02 Thread misu kun
Hi in this program test function has a known return value , and should be calculated in compile time , but fpc make it in real time !!! - program test; var c : int32; function test( p: int32): int32; inline; var i : int32; begin i := p; test := i+2+c+2+c+2+c; end; begin c: