[fpc-pascal] TParamFlags and fpc 3.2.0.

Sven Barth pascaldragon at googlemail.com
Fri Jul 26 23:53:23 CEST 2019

Am 26.07.2019 um 14:50 schrieb fredvs:
> But, imho, there is problem with the behavior of fpc-ptypeinfo and filter in
> TParamFlags.
> Dont worry, I will not annoy you with this.
There is no problem with PTypeInfo or TParamFlags. The tests for these 
functionalities pass without any issues on multiple platforms.

You should fix the cause (ignoring hidden parameters) and not the 
symptoms (hidding "$self"), because the latter will cause you a headache 
further down (e.g. if you have a function with an open array parameter 
which will have a "$highArgN" parameter for each open array).

That said the code I showed you had an issue which might explain the 
behaviour you got:

=== code begin ===

  for int1:= 0 to paramcount - 1 do begin
       with params[int1] do begin
// replace previous line with:
   with params[count] do begin

            flags:= tparamflags(
            inc(po1,{$ifdef mse_fpc_3_2}2{$else}1{$endif});

// the following code block of mine
{$ifdef mse_fpc_3_2}
   // skip hidden parameters ($self, $high, etc.)
   if pfHidden in flags then
// up until here, needs to be further down (see below)
// so remove this block again

        name:= getshortstring(po1);
        typename:= getshortstring(po1);
        if (typename = 'WideString') or (typename = 'UnicodeString') then
         typename:= 'msestring';
        else begin
         if typename = 'LongInt' then begin
          typename:= 'Integer';
         else begin
          if typename = 'Double' then begin
           typename:= 'Real';
       end; // I think this is the end of the with-clause
// we adjust the code a little bit as the continue is not needed at this 
// this way we always increase the count on < 3.2 and only if it's not 
// on >= 3.2; we need to put this at the end so that po1 is advanced 
{$ifdef mse_fpc_3_2}
   // skip hidden parameters ($self, $high, etc.)
   if not (pfHidden in flags) then

=== code end ===

This should hopefully solve the issue.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190726/aa07eacf/attachment.html>

More information about the fpc-pascal mailing list