Wiki copymirror

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

User Changes 3.2.0

About this page

Listed below are intentional changes made to the FPC compiler (3.2) since the previous release that may break existing code. The list includes reasons why these changes have been implemented, and suggestions for how you might adapt your code if you find that previously working code has been adversely affected by these recent changes.

The list of new features that do not break existing code can be found here.

Please add revision numbers to the entries from now on. This facilitates moving merged items to the user changes of a release.

All systems

Usage Changes

Library search directories and custom sysroots

Additional {$include} variables

Overview
The {$include} directive now recognizes the additional internal variables

Remedy
You cannot name and use environment variable expansion with any of those names.

svn
30873 (current routine), 38329 (date and time)

Implementation Changes

Dynamic array parameters are passed like pointers

VMT Interface table uses private variable FPC_EMPTYINTF

Modeswitch TypeHelpers in Delphi modes enables type helper-syntax

Class references in a class VMT's field table

Property field access lists no longer allows classes

pascal
unit Test;
{$mode objfpc}

interface

type
  TTest1 = class
    Field: String;
  end;

  TTest2 = class
  private
    fTest1: TTest1;
  public
    property Prop: String read fTest1.Field; // Error "Record or object type expected"
  end;

implementation

end.

Range checking for enumeration constants in Delphi mode

Language Changes

Visibility of generic type parameters

pascal
type
  generic TTest<T> = class
  public type
    TAlias = T;
  end;

Parsing of specialize has been changed

Operator overload + no longer allowed for dynamic arrays

Generic type parameters need to match

Visibility of methods implementing interface methods

Methods implementing interface methods and overloads

Objective-C "Related Result Type"

pascal
{$mode objfpc}
{$modeswitch objectivec1}

type
  FPCMyType = objcclass
    function init: id; message 'init';
    class function alloc: FPCMyType; message 'initWithValue';
    // since ObjCBool is not related to FPCMyType, the "related result type" rule will not apply here
    // even though the message starts with "retain" and it's a class method
    class function retainCounting: ObjCBool; message 'retainCounting';
  end;

...

var
  a: NSArray;
begin
  // will give an error even though FPCMyType returns 'id', because 'id' is related to
  // FPCMyType and hence the compiler will now interpret the 'init' message as returning
  // an "FPCMyType" when called. Do note that the actual return type of "init" remains
  // "id" in all other contexts, e.g. when deciding override compatibility. The declaration
  // of that method is not modified, and the only changed behviour is that when calling it
  // the result type is statically assumed to be of FPCMyType.
  a:=FPCMyType.alloc.init;
end;

RTTI changes

RTTI for Interfaces (published property count)

RTTI for COM Interfaces (IID String)

RTTI Binary format change

RTTI for Corba Interfaces (IID String)

Reference to Record Init Information

TOrdType extended

New OrdType field for tkInt64 and tkQWord

First field of TProcedureParam changed

TParamFlag extended for constref

Ranges of Boolean types adjusted

OrdType of Boolean64 and QWordBool adjusted

All Boolean types have TypeKind tkBool

TParamFlag extended for hidden parameters

Parameters of method pointer variables contain hidden parameters

Parameters of procedure variables contain hidden parameters

Implicit default values for real, pointer and string properties

Unit changes

SysUtils

faSymlink
FileExists on Unix-based systems

Classes.TList auto-growth

Math Min/Max

StrUtils AnsiStartsText/AnsiEndsText

Types IStream interface and Classes TStreamAdapter

Baseunix (Linux only)

Classes TStrings.LoadFromStream/File encoding handling

TStringStream now observes system encoding
TStringStream derives from TBytesStream

DB

TParam.LoadFromFile sets share mode to fmShareDenyWrite
CodePage aware TStringField and TMemoField
ODBC headers on Unix platforms defaults to 3.52 version
TBlobData opaque type reworked to TBytes

FGL

Declaration of type TTypeList changed

objcbase

SimpleIPC

Process Unit

RunCommand
poNoConsole on Windows

fpHTTPClient and fpHTTPServer Units

Linux/Android platforms

GNU Binutils 2.19.1 or later are required by default

Stack alignment on Linux/i386

i386 platforms

The Pascal calling convention now follows Delphi conventions on 32 bit x86 platforms

-Ooasmcse/{$optimization asmcse} has been removed

i8086 platforms

the codepointer type has been changed in the small and compact memory models

Darwin/macOS platforms

Default Target macOS version

Darwin/i386 and calling conventions whereby the callee removes stack parameters

Windows platforms

GNU Binutils 2.25 or later are required by default

Previous release notes


From the Free Pascal wiki, page "User Changes 3.2.0", as it stood on 2022-04-03 after a change by Alextpp, 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 .