[fpc-pascal] Strange message about mixed signed expression

Jürgen Hestermann juergen.hestermann at gmx.de
Tue Jan 21 18:33:22 CET 2014


I always wondered why I get a compiler message for the following code snipped:

----------------------------------------------------------------------------
function Match(M,F : UTF8String) : boolean;
var i : Cardinal;

...

if i+length(M)<length(F) then
...

----------------------------------------------------------------------------

For the last code line I get:

unit1.pas(1097,14) Hint: Mixing signed expressions and longwords gives a 64bit result

But where are signed expressions involved?
i is Cardinal (so it cannot be negative) and
the two length-statements can also never be negative.
There is no substraction so why this message?
Anybody knows?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140121/1ac85782/attachment.html>


More information about the fpc-pascal mailing list