Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

User Changes 2.6.0

About this page

Below you can find a list of intentional changes since the previous release that can change the behaviour of previously working code, along with why these changes were performed and how you can adapt your code if you are affected by them. The list of new features can be found here.

All systems

Usage Changes

The Static modifier is now always enabled

The POINTERARITHMETICS mode switch has been replaced with the POINTERMATH directive

Compiler no longer searches for utilities in the current directory

Language changes

Passing derived classes to var- and out-parameters

pascal
{$mode objfpc}

type
  ta = class
  end;

  tb = class(ta)
    procedure dosomething;virtual;
  end;

procedure tb.dosomething;
begin
  // ...
end;

var
  b: tb;

procedure test(var a: ta);
begin
  a:=ta.create;
  // now b contains an instance of type "ta"
end;

begin
  b:=nil;
  test(b);
  // the following call can lead to access violations
  // or other hard to debug errors
  b.dosomething;
end.

The compiler used to accept the above program, but now it will give an error at the call to test.

Array of const parameters and cdecl routines

String constants longer than 255 chars

Short/Ansistring typed constants containing widechars/unicodechars

pascal
{$codepage utf8}

{ this example assumes that the source file has been saved using utf-8 encoding }

const
  s1: shortstring = 'éà';
  s2: ansistring = #$094#$06D;
  s3: ansistring = #267#543;
begin
end.

All three declarations above used to be accepted, but are now rejected. The reasons are that

In all cases, the practical upshot is that the string on the right hand side of the assignment will be treated as a wide/unicodestring constant at compile time.

Implicit "result" variable in MacPas mode

Result type of the addr() operator

Inaccessible symbols and properties

<Ordinal> in <Set type> is now forbidden

Support for class and record helpers

pascal
{$mode delphi}
type
  TSomeRecord = class
     helper: integer;
  end;

  TSomeRecord = record
     helper: integer;
  end;

The above code will no longer compile.

Taking the address of fields of record properties

Generics syntax in Delphi mode

Implementation changes

Order of parameters in RTTI

Sizes of sets in TP/Delphi mode

Constants in mixed signed/unsigned 64 bit expressions

pascal
const
  // note that 64 bit hexadecimal constants are always parsed as int64
  // (also by previous FPC releases)
 BIG_A = $AB09CD87EF653412;
var
 q : qword;
begin
 q := qword(BIG_A);
 if (q = BIG_A) then
   writeln('same')
 else
   writeln('different');
end.

The above program used to print 'same', but will now print 'different'

Overflow/Rangechecking for floating point constants

New element in TTypeKind enumeration

Padding of object/class types

Mangling of variables, typed constants and internally used symbols

Using resourcestrings to initialize typed string constants

pascal
{ before }
resourcestring
  str1='foo';
const
  str2: string=str1;

{ after }
const
  str2: string='foo';

Unit changes

SysUtils.GetAppConfigDir() now uses VendorName

IniFiles.WriteString() no longer deletes empty values

IniFiles.DeleteKey() no longer deletes empty sections

xmlrpc unit and utils have been removed

IInterface.QueryInterface, ._AddRef and ._Release definitions have been changed

pascal
 function QueryInterface(constref IID: TGUID; out Obj): HResult; {$ifndef windows}cdecl{$else}stdcall{$ifend}; override;
 function _AddRef: Integer; {$ifndef windows}cdecl{$else}stdcall{$ifend}; override;
 function _Release: Integer; {$ifndef windows}cdecl{$else}stdcall{$ifend}; override;

You can also use the following more verbose alternative, in case the code has to be compilable by older FPC versions as well:

pascal
 function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} IID: TGUID; out Obj): HResult; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; override;
 function _AddRef: Integer; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; override;
 function _Release: Integer; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; override;

thread_count removed from system unit (win32,win64,wince, symbian, nativent)

Locale global variables are deprecated

CustApp logging changes

fpweb T(Custom)FPWebModule.Template property

HTTP (Apache) units changes

fcl-image has a different default compression when writing PNGs

Some fields of the generics in the fgl were public or protected by accident

regexpr.pp was renamed to oldregexpr.pp

SQLDB/TSQLite3Connection now stores date[time] values as Julian day numbers

Unix platforms

SysUtils.FileAge no longer works for directories

x86 platforms

Operation size of pushf/popf/pusha/popa in Intel-style inline assembly

x86-64 platforms

Parameter passing and returning results on x86-64 platforms (except for Win64)

Const parameter passing on non-Win64 platforms

Previous release notes


From the Free Pascal wiki, page "User Changes 2.6.0", as it stood on 2020-03-03 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .