| ??? 11/10/11 10:53 Read: times |
#184607 - Keil problem... |
Hello all,
I have a problem with definition of variables in Keil that causes an unspecified error during data processing in a part of my code that doesn't relate to these variables... I am not able to localize the place where the problem occurs as the code is very large and there is no on-chip debugging. After many experiments, I have found how to avoid the problem - it is only a small nuance, see below. Now I am not sure if it is my or compiler fault. I have Keil uVision3 v3.51 (C Compiler v8.08) and Atmel AT89C51ED2. This definition causes the error:
typedef struct {
BYTE ip_addr[4];
} IP_ADDR;
IP_ADDR broadcast_IP = {255,255,255,255};
IP_ADDR zero_ip = {0, 0, 0, 0};
IP_ADDR ip_addrr;
This definition doesn't cause the error:
typedef struct {
BYTE ip_addr[4];
} IP_ADDR;
IP_ADDR ip_addrr;
IP_ADDR broadcast_IP = {255,255,255,255};
IP_ADDR zero_ip = {0, 0, 0, 0};
This definition doesn't cause the error:
typedef struct {
BYTE ip_addr[4];
} IP_ADDR;
IP_ADDR code broadcast_IP = {255,255,255,255};
IP_ADDR code zero_ip = {0, 0, 0, 0};
IP_ADDR ip_addrr;
This definition doesn't cause the error:
typedef struct {
BYTE ip_addr[4];
} IP_ADDR;
IP_ADDR data broadcast_IP = {255,255,255,255};
IP_ADDR data code zero_ip = {0, 0, 0, 0};
IP_ADDR data ip_addrr;
Thank you very much for your opinion... |



