mP PRO 1.40 - signed constants phoney error

Beta Testing discussion on mikroPascal PRO for PIC.
Post Reply
Author
Message
janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

mP PRO 1.40 - signed constants phoney error

#1 Post by janni » 18 Apr 2009 17:58

When assigning a signed constant with negative value declared in a unit, like

Code: Select all

const my_short_const: short = -1;
to the same type variable in main unit, the compiler issues an error 'Argument is out of range..'. Explicitely specifying the type, like

Code: Select all

my_short_var := short(my_short_const);
prevents the error to show up. This concerns any signed integral type. There is no such problem, though, if the constant is declared in main unit.

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: mP PRO 1.40 - signed constants phoney error

#2 Post by zristic » 22 Apr 2009 13:04

Thanks.
We will fix this asap.

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

Re: mP PRO 1.40 - signed constants phoney error

#3 Post by srdjan » 22 Apr 2009 13:17

Hi,
janni wrote:When assigning a signed constant with negative value declared in a unit, like

Code: Select all

const my_short_const: short = -1;
to the same type variable in main unit, the compiler issues an error 'Argument is out of range..'. Explicitely specifying the type, like

Code: Select all

my_short_var := short(my_short_const);
prevents the error to show up. This concerns any signed integral type. There is no such problem, though, if the constant is declared in main unit.
I can not reproduce this, it could be that it was fixed in the meantime. Could you, please, give me a code example to srdjan@mikroe.com?

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: mP PRO 1.40 - signed constants phoney error

#4 Post by janni » 22 Apr 2009 17:48

srdjan wrote:I can not reproduce this, it could be that it was fixed in the meantime. Could you, please, give me a code example to srdjan@mikroe.com?
Wouldn't be the first time you fixed something before it was noticed :) . An example was sent.

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

Re: mP PRO 1.40 - signed constants phoney error

#5 Post by srdjan » 23 Apr 2009 08:14

janni wrote:
srdjan wrote:I can not reproduce this, it could be that it was fixed in the meantime. Could you, please, give me a code example to srdjan@mikroe.com?
Wouldn't be the first time you fixed something before it was noticed :) . An example was sent.
Yes, it was a bug :wink: Fixed. Thanks.

Post Reply

Return to “mikroPascal PRO for PIC Beta Testing”