Val() procedure accepts PChar in {$mode fpc}, but not in {$mode tp} lazarus / 62-General ---------------------------------------------------------------------- Avinash · 2021-05-25 19:43 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$IFDEF FPC}{$MODE TP}{$ENDIF}const  P: PChar = '1234';var  I, J: Integer;begin  Val(P, I, J);  WriteLn(I);end. This will be compiled by Turbo Pascal, however FPC does not compile this in TP mode, although it compiles in FPC/OBJFPC modes: val.pas(7,8) Error: Incompatible type for arg no. 2: Got "PChar", expected "ShortString" val.pas(9,4) Fatal: There were 1 errors compiling module, stopping ---------------------------------------------------------------------- Bart · 2021-05-26 20:39 Well, does it compile in TP? If not, then it should not in {$mode tp}. Bart ---------------------------------------------------------------------- winni · 2021-05-26 22:56 Hi! I don't know what the TP definition for fpc is but: TP 5.5 does not know pchar TP 7.0 needs the extended syntax switch {$X+} Just tested. Winni ---------------------------------------------------------------------- marcov · 2021-05-27 07:59 Quote from: winni on May 27, 2021, 12:56:18 amI don't know what the TP definition for fpc is but: TP7.   Seems mode FPC accept it always, and mode TP never, regardless of $X+  (FPC 3.2.2) Please file a bug. It might not be fixable (e.g. due to multiple VAL overloads in the system unit), but at least it can be documented