[fpc-pascal] constref question

José Mejuto joshyfun at gmail.com
Sat Mar 5 00:09:29 CET 2011


Hello FPC-Pascal,

The parameter passing mode "constref" ensures that something is passed
as reference and never as value, so my question is using something
like this:

type
  pmyrec=^myrec;
  myrec=record
    a: integer;
    b: integer;
    c: integer;
  end;

  MyInterf = interface
  [....]
    procedure test(const param: pmyrec); safecall;
  end;

Calling test is ok, but if I define test as:

  MyInterf = interface
  [....]
    procedure test(constref param: pmyrec); safecall;
  end;

it fails with a sigsegv. Are both expected to have the same behavior
in this case ? (pointer to record).
  
-- 
Best regards,
 José




More information about the fpc-pascal mailing list