Sign in Join
Wiki copytemporary

FPC New Features 3.0.0

About this page

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

All systems

Language

Delphi-like namespaces units

Dynamic array constructors

New compiler intrinsic Default

pascal
type
  TRecord = record
    i: LongInt;
    s: AnsiString;
  end;

var
  i: LongInt;
  o: TObject;
  r: TRecord;
begin
  i := Default(LongInt); // 0
  o := Default(TObject); // Nil
  r := Default(TRecord); // ( i: 0; s: '')
end.
pascal
type
  generic TTest<T> = class
    procedure Test;
  end;

procedure TTest.Test;
var
  myt: T;
begin
  myt := Default(T); // will have the correct Default if class is specialized
end;

Support for type helpers

Support for codepage-aware strings

New delphiunicode syntax mode

Code generator

Class field reordering

Removing the calculation of dead values

Shortcuts to speed up floating point calculations

Constant propagation

Dead store elimination

Node dfa for liveness analysis

pascal
  var
    b : boolean;
    i : longint;
  begin
    if b then
      i:=1;
    writeln;
    if b then
      writeln(i);
  end.

In this case, the compiler warns about i being uninitialized. While some cases like the case above could be detected and the warning could be prevent, this does no apply if b is a function. To workaround this, add an assignment to i at the entry of the subroutine body.

The same applies to functions/procedures:

pascal
  var
    i : longint;
  procedure p;
    begin
      i:=1;
    end;
  begin
    p;
    writeln(i);
  end.

The current dfa approach works only intra-procedurally instead of globally, so the above case cannot yet be handled correctly. The compiler does not see that i is initialized. To work around this, add an assignment to i at the entry of the outer subroutine body.

Units and packages

TDBF support for Visual FoxPro files

Additionally, TDBf is now included in the database test suite and has received several fixes (including better Visual FoxPro codepage support).

Bufdataset supports ftAutoInc fields

TDBF, bufdataset (and descendents such as TSQLQuery) allow escaped delimiters in string expression filter

Support has been added for escaping quotes to allow this.

pascal
Filter:='(NAME=''O''''Malley''''s "Magic" Hammer'')';
//which gives
//(NAME='O''Malley''s "Magic" Hammer')
//which will match record
//O'Malley's "Magic" Hammer

TODBCConnection (odbcconn) Support for 64 bit ODBC

TZipper support for zip64 format

Multiple codepage and unicode support for most file-related RTL routines

SQL parser/generator improvements

Tools and miscellaneous

New Pas2jni utility

(Mac) OS X/iOS

New iosxlocale unit

New compiler targets

Support for the Java Virtual Machine and Dalvik targets

Support for the AIX target

Support for the 16-bit real mode MS-DOS target

Support for the Android target

Support for the armhf EABI

Support for the AROS target

New Features from other versions


From the Free Pascal wiki, page "FPC New Features 3.0.0", as it stood on 2023-05-25 after a change by Alextp, 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 .

Edited on wiki.freepascal.org by 11 people, 2015–2023

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
JonasSkeleton page for new features in 3.0
JonasNew features that will be in FPC 3.0
JonasMention that FPC 3.0 is not yet out (minor)
JonasNew iosxlocale unit (minor)
NickysnNew compiler targets
FTurtle (minor)
JonasNew compiler targets: Mention support for armhf (minor)
JonasSupport for the armhf EABI (minor)
YurysidorovAndroid target
MollyNew compiler targets: Add AROS target
FTurtle
MollySupport for the AROS target: link to AROS page
Dirk FellenbergFPC version 3.0.0 has been released. (minor)
Chain-QSupport for the AROS target: typo fix (minor)
PolluksDelphi-like namespaces units: typo
JonasLanguage: Explain the meaning of {$mode delphiunicode}
JonasNew delphiunicode syntax mode (minor)
MollySupport for the AROS target: Removed reference to ABI-v0-on-trunk, it's obsolete as it replaced v0.
MollySupport for the AROS target: Mention presence of native compiler
TrevFixed syntax highlighting (minor)
Kai BurghardtKai Burghardt moved page FPC New Features 3.0 to FPC New Features 3.0.0: consistent naming scheme with all FPC New Features pages (minor)
Kai BurghardtNew compiler intrinsic Default: deorphan page Default
Alextpfix dead URL

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.