i use keil arm rvct and have small problem RVCT have no #pragma pack(1) but when i got program from my friend i didnt see this program and RVCT didnt say warning about this command - and i have problem because this command destroy execute program for example
#pragma pack(1)
typedef struct { unsigned char command; unsigned long packets; unsigned char reserved[3];
} COMMAND2;
int main() { COMMAND2 cmd2; unsigned long Size;
cmd2.command = 0x01; cmd2.packets = 1000; Size = cmd2.packets; Size = cmd2.command; }
when run this program Size <> 1 at the end !!!
undetermine command #pragma pack(1) create error and compiler dont say warning about this command if correct program for RVTC
typedef __packed struct { unsigned char command; unsigned long packets; unsigned char reserved[3];
we will get ok result
"Ah, very good. That wasn't too hard, was it? You have finally shown what the problem is.
For whatever ARM you are using or simulating, read up on how it handles unaligned memory accesses "
are you top manager? who may see - will be see
i finished this topic good bye baby ;-)
"i finished this topic good bye baby"
It is quite unusual to use such terms of endearment in a technical forum, but in case it is the custom where you are from:
Good-bye dear.