View previous topic :: View next topic |
Author |
Message |
mb91
Joined: 30 Oct 2007 Posts: 2
|
Error with "%" operator and int32 or int64 |
Posted: Tue Oct 30, 2007 4:04 am |
|
|
With this program and PCD compiler v4.059, the result is fault with "%" operator...
int32 a;
int32 b;
void main(void)
{
a= 0;
b=a%100;
// here b=100 error instead of 0
}
same problem with int64
Has any body the same problem ?
Do you have a solution ?
Thanks
MB |
|
|
Ken Johnson
Joined: 23 Mar 2006 Posts: 197 Location: Lewisburg, WV
|
|
Posted: Tue Oct 30, 2007 6:57 am |
|
|
When I find a definite bug like this appears to be, I build a simple project showing the bug, and submit it to ccs (support@ccsinfo.com). Given a clear simple example, they'll usually fix it (relatively) promptly.
Ken |
|
|
Ttelmah Guest
|
|
Posted: Tue Oct 30, 2007 9:57 am |
|
|
I'd report this, and switch back to an older compiler. Repeat this mantra after me: "The latest CCS compiler is only a beta"....
This is a 'famed' line from the 'old hands' here, because it is so tyical of CCS that they fix one thing, or add a new feature to the compiler, and in doing so, make half a dozen thing not work. Their idea of 'testing', seems to be to distribute the code, and see how many people complain... :(
Best Wishes |
|
|
Ttelmah Guest
|
|
Posted: Tue Oct 30, 2007 4:00 pm |
|
|
I have just tried this with 4.059, and it happily gives 0, as it should....
As a comment, int64, doesn't yet exist. Mention of it, has been added to the 'help', but it is still not listed as a type, and is not supported.
Best Wishes |
|
|
|