[fpc-pascal] Warning: Type size mismatch, possible loss of data / range check error

Peter peter at pblackman.plus.com
Thu Jun 18 17:37:25 CEST 2015

Hi Everybody,

I tried compiling with all warnings for a final polish/check on a
project, and seem to be getting a raft of false positives.
The following example stub gives two warnings;

Program test;

Const TAB = Char(Chr(9));

Var A : DWord;

A := 0;

Also I get the same warning on every 'SetLength' with a constant param,
and on every 'New' statement. Zillions of them in total, which makes it
very hard to see any genuine issues. (I did have a few, mixing

The problem occurs with BOTH switches -Cr & -CO
Any one of these, and the compiler is silent,
Is this a bug? Surely, the above A:=0; is valid Pascal isn’t it?


More information about the fpc-pascal mailing list