User Changes 2.6.0

This is an old revision of User Changes 2.6.0, edited by Marcov at . The current revision is 68837.

Initial version 2.6.0. Copied from trunk + changed some internal links from -trunk to the 2.6.0 counterparts.

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

Static keyword is enabled without switches and directives

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

<delphi> {$mode objfpc}

type

 ta = class
 end;
 tb = class(ta)
 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);

end. </delphi> 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

<delphi> {$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. </delphi> 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

<delphi> {$mode delphi} type

 TSomeRecord = class
    helper: integer;
 end;
 TSomeRecord = record
    helper: integer;
 end;

</delphi> The above code will no longer compile.

Anonymous inherited calls

Taking the address of fields of record properties

Implementation changes

Order of parameters in RTTI

Sizes of sets in TP/Delphi mode

Constants in mixed signed/unsigned 64 bit expressions

<delphi> 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. </delphi> 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

<delphi> { before } resourcestring

 str1='foo';

const

 str2: string=str1;

{ after } const

 str2: string='foo';

</delphi>

Unit changes

SysUtils.GetAppConfigDir() now uses VendorName

IniFiles.WriteString() no longer deletes empty values

IniFilesDeleteKey() no longer deletes empty sections

xmlrpc unit and utils have been removed

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

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

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

See also