FPC New Features 3.2.0 - Free Pascal wiki (original) (raw)

About this page

FPC 3.2.0 has been released on June 19th, 2020.

Below you can find a list of new features introduced since the previous release, along with some background information and examples.

A list of changes that may break existing code can be found at User Changes 3.2.

All systems

Compiler options

Default unit scopes

Language

Support for interfacing with C blocks functionality

Support for Default Namespaces

Dynamic Arrays supported by Insert()

Dynamic Arrays supported by Delete()

Dynamic Arrays supported by Concat()

Dynamic Arrays have built in + operator support

Dynamic Array constants and variable initialization

Dynamic Arrays constructors

More settings supported by $Push/$Pop

Support for threadvar sections inside class and record types

Support for Generic Routines

unit UTestObjFPCSyntax;

{$mode ObjFPC}

interface

generic function Add(const Arg1, Arg2: T): T;

implementation

generic function Add(const Arg1, Arg2: T): T; begin Result := Arg1 + Arg2; end;

end.

program TestObjFPCSyntax;

{$mode ObjFPC}{$H+}

uses UTestObjFPCSyntax;

begin Writeln(specialize Add('Hello', 'World')); Writeln(specialize Add(23, 19)); end.

unit UTestDelphiSyntax;

{$mode Delphi}

interface

function Add(const Arg1, Arg2: T): T;

implementation

function Add(const Arg1, Arg2: T): T; begin Result := Arg1 + Arg2; end;

end.

program TestDelphiSyntax;

{$mode Delphi}

uses UTestDelphiSyntax;

begin Writeln(Add('Hello', 'World')); Writeln(Add(23, 19)); end.

Management operators for record types

Method RTTI for interfaces

Support for helper types extending interface types

Support for "IsManagedType" intrinsic

Support for PE/COFF metadata directives

Support for WinAPI directive

Support for a distinct Boolean8 type

Units

rtl-generics units

Rtti unit

ProcessUnicode unit

Registry unit

CHM package

Text-mode IDE

GDB/MI support

macOS/iOS

New iosxwstr unit

Cocoaint units updated

i8086-msdos

Huge memory model

Internal assembler (object writer)

Internal linker

FarAddr internal function

Near and far procedure variables

type TFarProc = procedure(a, b: Integer); far; TNearProc = procedure(a, b: Integer); near;

Near procedure variables are 2 bytes long, so they contain only an offset. They are invoked with a near call instruction. Far procedure variables are 4 bytes long (16-bit offset + 16-bit offset) and are invoked with a far call. Note that you cannot simply convert a near procedure to a far procedure, by just filling in the segment part, because the call model is also different between near and far procedures. A far call instruction pushes a 4-byte far (segment:offset) return address and the function must terminate with a far return instruction - retf. A near call instruction pushes only a 2-byte offset on the stack and the function must terminate with a near return instruction - retn.

i386-go32v2

A new archive was added that contains alternative builds of the textmode IDE.

i386-win32

The i386-win32 target now defaults to using SEH compatible exceptions

x86_64-win64

Support for Microsoft's vectorcall calling convention

New compiler targets

Support for the AArch64 target

Support for the Linux/ppc64le target

Support for the Android/x86_64 target

Support for the i8086-win16 (16-bit Windows) target

New Features from other versions

Lazarus - Release Notes and GIT Branch with Release Fixes

Release notes for Version:

Free Pascal Compiler - User Changes (Release Notes)