Re: [Lazarus] Warning about integer constant and expression

2016-02-23 Thread Jürgen Hestermann

Am 2016-02-23 um 19:42 schrieb Mattias Gaertner:

On Tue, 23 Feb 2016 18:28:29 +0100
Jürgen Hestermann  wrote:


WIth this definition:

var  i64 : Int64;

and this code:

if i64>High(SizeInt) then

I get:
"Warning: Comparison might be always false due to range of constant and 
expression"
And even more strange, if I convert the constant to int64 as in

if i64>int64(High(SizeInt)) then

I still get this warning.
Why?

Because on a 64bit system SizeInt = int64.


Yes, you are right.
I am using 64bit free pascal only for a short while now.
And because I compile for 32 bit too I will leave it as it is.
Thanks for clarifying/reminding me.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Warning about integer constant and expression

2016-02-23 Thread Mattias Gaertner
On Tue, 23 Feb 2016 18:28:29 +0100
Jürgen Hestermann  wrote:

> WIth this definition:
> 
> var  i64 : Int64;
> 
> and this code:
> 
> if i64>High(SizeInt) then
> 
> I get:
> "Warning: Comparison might be always false due to range of constant and 
> expression"
> And even more strange, if I convert the constant to int64 as in
> 
> if i64>int64(High(SizeInt)) then
> 
> I still get this warning.
> Why?

Because on a 64bit system SizeInt = int64.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Warning about integer constant and expression

2016-02-23 Thread wkitty42

On 02/23/2016 12:28 PM, Jürgen Hestermann wrote:


if i64>int64(High(SizeInt)) then


if i64>(high(int64(SizeInt)) then

??

--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Warning about integer constant and expression

2016-02-23 Thread Jürgen Hestermann

WIth this definition:

var  i64 : Int64;

and this code:

if i64>High(SizeInt) then

I get:
"Warning: Comparison might be always false due to range of constant and 
expression"
And even more strange, if I convert the constant to int64 as in

if i64>int64(High(SizeInt)) then

I still get this warning.
Why?


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus