[fpc-devel] Bug in trunk?

Martin Schreiber fpmse at bluewin.ch
Fri Mar 28 07:47:24 CET 2008


Hi,
What is wrong with this code:
"
program rangeerror;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
{$ifdef mswindows}{$apptype console}{$endif}
uses
 {$ifdef FPC}{$ifdef linux}cthreads,{$endif}{$endif}
 sysutils;
type
 colorty = type longword;
const
 cl_mapped = colorty($90000000);
type
 ttestclass = class
  private
   fcolor: colorty;
  published
   property color: colorty read fcolor write fcolor default cl_mapped; //<<--
 end; 
begin
end.
"
"
Free Pascal Compiler version 2.3.1 [2008/03/27] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for i386
Compiling rangeerror.pas
rangeerror.pas(16,70) Error: range check error while evaluating constants
rangeerror.pas(21) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
"
Delphi7 and FPC fixes_2_2 compile fine.

Martin



More information about the fpc-devel mailing list