ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Четверг
18 июля
1436067
IBAH (17.05.2024 17:15, просмотров: 396)
Объясните темному, почему ИАР не дал варнинга за обращение за пределы массива? С этим глюком чуть не впендюрился. 
//main.h
#define LampP PortOut[1].out6 //Мигалка +
#define LampN PortOut[1].out7 //Мигалка -

//main.c
{LampN^=1;LampP^=1;}//Мигалка

//ioport.h
#define KolvoPortov (1)
typedef union
  {
  unsigned char out8; //порт целиком
  struct
    {
    unsigned char out0:1; //порт out0
    unsigned char out1:1; //порт out1
    unsigned char out2:1; //порт out2
    unsigned char out3:1; //порт out3
    unsigned char out4:1; //порт out4
    unsigned char out5:1; //порт out5
    unsigned char out6:1; //порт out6
    unsigned char out7:1; //порт out7
    };
  }Out_t;
#ifdef __IOPORT_C //только для модуля _IOPORT_C
Out_t PortOut[KolvoPortov];
#else
extern Out_t PortOut[KolvoPortov];
#endif