win10
compiler: Microchip xc8
In the header File:
typedef union
{
uint8_t Bytes[4];
uint32_t Word;
}BYTES_TO_WORD;
extern BYTES_TO_WORD MyBytes;
In the 'C' File with the declairation in it
#include "commonheaderfile.h"
BYTES_TO_WORD MyBytes;
in other 'C' files
#include "commonheaderfile.h"
MyBytes.Word=123445677;
上述这样是正常运作,结果我不小心在other 'C' file也下了BYTES_TO_WORD MyBytes;
编译还是过,运作也没问题,奇怪这样不是重复定义?
BYTES_TO_WORD MyBytes; 不就会给内存区块了吗?
谢谢