[fpc-pascal] FPC bug or brain bug ?
Jonas Maebe
jonas.maebe at elis.ugent.be
Thu May 27 22:34:16 CEST 2010
On 27 May 2010, at 16:01, Yann Bat wrote:
> I don't understand why compilation of the program below failed in fpc
> and objfpc mode. In tp and delphi mode it works as expected but in fpc
> and objfpc mode the compiler complains :
>
> blob.pas(17,3) Error: Constants of objects containing a VMT aren't allowed
> blob.pas(17,3) Fatal: Syntax error, ";" expected but "(" found
>
> Since my object has no virtual methods why a VMT ?
The compiler always adds a VMT if an object has a constructor or destructor. The reason is that the VMT also contains the instance size, which is used by the constructor helper to allocate the required amount of memory.
Jonas
More information about the fpc-pascal
mailing list