This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Weird behaviour with struct

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "compiler_defs.h"
#include "C8051f380_defs.h"
#include <stddef.h>
struct MASTER
{
int cmd[2];
};
xdata struct MASTER mstr;
//-----------------------------------------------------------------------------
void main(void)
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Hi guys:

The attached code has a structure with one member array of 2 elements. This code compiles and it shouldn't: note in main() that there's access to the member without an index and the compiler is not giving any error.

What's going on here?

I am using Silabs 8051F380 processorC51 , compiler V9.55, and BL linker V6.22

Thanks!!!

0