FPC New Features Trunk

This is an old revision of FPC New Features Trunk, edited by BigChimp at . The current revision is 71454.

/* Units and packages */ autoinc support bufdataset

About this page

Below you can find a list of new features introduced since the previous release, along with some background information and examples. Note that since svn trunk is by definition still under development, some of the features here may still change before they end up in a release version.

A list of changes that may break existing code can be found here.

All systems

Language

Delphi-like namespaces units

Dynamic array constructors

New compiler intrinsic Default

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

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

 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 nested functions/procedures:

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

The current dfa approach works only procedure-wide and not global, so the case above cannot be handled correctly. The compiler does not see that i is initialized. To workaround 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.

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

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

See also