Difference between revisions of "User Changes Trunk"

From Lazarus wiki
Jump to navigationJump to search
m (Changed "previous release" link so it points to the 3.0 page)
Line 30: Line 30:
 
* '''Reason''': This allows for a more logical usage of ''specialize'' in context with nested types (especially if multiple specializations are involved) and more importantly generic functions and methods.
 
* '''Reason''': This allows for a more logical usage of ''specialize'' in context with nested types (especially if multiple specializations are involved) and more importantly generic functions and methods.
 
* '''Remedy''': Put the ''specialize'' directly in front of the type which needs to be specialized.
 
* '''Remedy''': Put the ''specialize'' directly in front of the type which needs to be specialized.
 +
 +
=== Unit changes ===
 +
 +
==== DB ====
 +
===== SQLiteConnection: Boolean True values are stored as 1 not as -1  =====
 +
* '''Old behaviour''': Boolean True parameters was bind as integer = -1.
 +
* '''New behaviour''': Boolean True parameters are bind as integer = 1. As expected by SQLite: "SQLite does not have a separate Boolean storage class. Instead, Boolean values are stored as integers 0 (false) and 1 (true)."
 +
* '''Reason''': Align with SQLite specification and also with others DB components (like SQLite3DataSet), which expect True=1
 +
* '''Remedy''': Check your applications and if your tables contain boolean columns which are part of primary key or you use in WHERE clause constructs like "boolean_column=:boolean_param" then you must take attention to fix database or use construct like: "ABS(boolean_column)=:boolean_param"
  
 
== i386 platforms ==
 
== i386 platforms ==

Revision as of 14:33, 17 June 2015

About this page

Listed below are intentional changes made to the FPC compiler (trunk) 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

Language Changes

Visibility of generic type parameters

  • Old behaviour: Type parameters of generics had public visibility.
  • New behaviour: Type parameters of generics now have strict private visibility.
  • Reason: With the previous visibility it was possible to create code that leads to infinite loops during compilation or other hard to debug errors. In addition there is no real possibility to work around this issue (for an example see this bug report). Also the fix is Delphi compatible.
  • Remedy: Declare a type alias for the type parameter with the desired visibility.
  • Example: In the following example T is declared as strict private, while TAlias is declared as public and thus can be used as before the change.
type
  generic TTest<T> = class
  public type
    TAlias = T;
  end;

Parsing of specialize has been changed

  • Old behaviour: specialize was used to initialize a specialization and was followed by a type name that might contain a unit name and parent types.
  • New behaviour: specialize is now considered part of the specialized type, just as generic is. This means that unit names and parent types need to be used before the part containing the specialize.
  • Reason: This allows for a more logical usage of specialize in context with nested types (especially if multiple specializations are involved) and more importantly generic functions and methods.
  • Remedy: Put the specialize directly in front of the type which needs to be specialized.

Unit changes

DB

SQLiteConnection: Boolean True values are stored as 1 not as -1
  • Old behaviour: Boolean True parameters was bind as integer = -1.
  • New behaviour: Boolean True parameters are bind as integer = 1. As expected by SQLite: "SQLite does not have a separate Boolean storage class. Instead, Boolean values are stored as integers 0 (false) and 1 (true)."
  • Reason: Align with SQLite specification and also with others DB components (like SQLite3DataSet), which expect True=1
  • Remedy: Check your applications and if your tables contain boolean columns which are part of primary key or you use in WHERE clause constructs like "boolean_column=:boolean_param" then you must take attention to fix database or use construct like: "ABS(boolean_column)=:boolean_param"

i386 platforms

-Ooasmcse/{$optimization asmcse} has been removed

  • Old behaviour: The compiler contained an assembler common subexpression elimination pass for the i386 platform.
  • New behaviour: This optimisation pass has been removed from the compiler.
  • Reason: That pass has been disabled by default since several releases because it hadn't been maintained, and it generated buggy code when combined with newer optimisation passes.
  • Remedy: Don't use -Ooasmcse/{$optimization asmcse} anymore.

Previous release notes