Not applicable
Nov 11, 2014
04:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 11, 2014
04:15 AM
Tools: Keil uVision 4, source code from Tasking IDE, adapted in the way like
Application code:
What should I expect with such syntax?
The thing is that there is 0x5151 in memory with say 0x00c40000 address, but I got 0x0000202e instead.
I experimented a bit and found that if
then 'var' receives correct value 0x5151.
Why may I have such effect? Is it sufficient way to bypass the bug or it is a lame way?
#define __shuge huge
Application code:
int __shuge *ptr;
int var;
var = *ptr;
What should I expect with such syntax?
The thing is that there is 0x5151 in memory with say 0x00c40000 address, but I got 0x0000202e instead.
I experimented a bit and found that if
int __shuge *ptr;
int var;
var = *(int)ptr;
then 'var' receives correct value 0x5151.
Why may I have such effect? Is it sufficient way to bypass the bug or it is a lame way?
- Tags:
- IFX
2 Replies
Nov 11, 2014
06:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 11, 2014
06:25 PM
hi,
You should use 'long' since shuge(signed huge) is 32 bits, 'int' is 16 bits.
Best Regards
Jurgen
You should use 'long' since shuge(signed huge) is 32 bits, 'int' is 16 bits.
Best Regards
Jurgen
Not applicable
Nov 11, 2014
10:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 11, 2014
10:36 PM
Juergen wrote:
hi,
You should use 'long' since shuge(signed huge) is 32 bits, 'int' is 16 bits.
Best Regards
Jurgen
Well, originally it was long (ulong), the same bug =(
BTW this code is from Infineon EEPROM driver.