 |
bladox.com Turbo SIM Toolkit Adapter Forums
|
View previous topic :: View next topic |
Author |
Message |
jacko
Joined: 20 Dec 2010 Posts: 19
|
Posted: Tue Feb 15, 2011 10:17 am Post subject: Bug: initializers not working |
|
|
Hello,
In a function I do the following :
void test()
{
const u8 test_single = 0x3F;
const u8 test_multiple[] = { 0x3F, 0x00, 0x11, 0x22, 0x33, 0x44 };
dbch(test_single); dbc('\n');
for (u8 i=0; i<6; i++)
dbch(test_multiple[i]);
}
The output is something like
3f
606f42f4bf
It looks like there is a low level bug which prevent the tables from being initialized or programmed properly.
This looks like a severe bug; I am using the precompiled toolchain from Bladox on Linux (avr1.tgz), with a Makefile I got from Bladox samples too.
Any idea? |
|
Back to top |
|
 |
pz
Joined: 12 Mar 2004 Posts: 1161
|
Posted: Tue Feb 15, 2011 5:13 pm Post subject: |
|
|
It's a feature, not bug.
Use u8 PROGMEM t_test_multiple[] = { 0x3F, 0x00, 0x11, 0x22, 0x33, 0x44 }; out off the call to store it in flash. Then explicitly init the array with memcpy(). |
|
Back to top |
|
 |
jacko
Joined: 20 Dec 2010 Posts: 19
|
Posted: Wed Feb 16, 2011 8:31 am Post subject: |
|
|
pz wrote: | It's a feature, not bug. |
Well, you should really document that "feature" somewhere, because it is not compliant with the C standard, and the compiler (nor objdump --turbo) does not emit any warning.
Is there a page somewhere that lists that sort of limitations ?
I have no problems with limitations such as this one, unless they are not documented and the compiler does not show any error...
As a result, use of any library which uses that feature (which is authorized by the C standard) will not work correctly. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|