ChameleonMini icon indicating copy to clipboard operation
ChameleonMini copied to clipboard

Conflict in 'Uid' Variable Definitions Across Different Files

Open wai666 opened this issue 7 months ago • 1 comments

Hello,

I'm currently working on a project involving two C files, ISO15693-A.c and MifareClassic.c, and I've encountered a conflict in the declarations of the Uid variable between these two files. This issue is causing a linker error and I'm seeking assistance to resolve it.

In ISO15693-A.c, the Uid variable is declared as an array of type uint8_t with the size defined by ISO15693_GENERIC_UID_SIZE. However, in MifareClassic.c, the Uid variable is declared as a uint8_t array with a fixed size of 4. The differing sizes of the Uid array in these two files are causing a compilation warning and a linker error, as indicated in the error message below:c:/users/administrator/desktop/avr-gcc-12.1.0-x64-windows/bin/../lib/gcc/avr/12.1.0/../../../../avr/bin/ld.exe: disabling relaxation; it will not work with multiple definitions Application/ISO15693-A.c:6:9: warning: type of 'Uid' does not match original declaration [-Wlto-type-mismatch] 6 | uint8_t Uid[ISO15693_GENERIC_UID_SIZE]; | ^ Application/MifareClassic.c:589:9: note: array types have different bounds 589 | uint8_t Uid[4]; | ^ Application/MifareClassic.c:589:9: note: 'Uid' was previously declared here lto-wrapper.exe: warning: using serial compilation of 2 LTRANS jobs lto-wrapper.exe: note: see the '-flto' option documentation for more information collect2.exe: error: ld returned 1 exit status make: *** [../LUFA/Build/lufa_build.mk:320: Chameleon-RevG.elf] Error 1 I have also checked the header file MifareClassic.h for any relevant declarations, but couldn't find a direct reference to the Uid variable.

I'm unsure whether these files should use the same size for Uid or if they are intended to have different sizes for specific reasons. Could you please provide guidance on how to resolve this conflict? Should I modify the Uid size in one of the files to match the other, or is there a different approach I should consider?

Thank you for your assistance.

wai666 avatar Nov 30 '23 03:11 wai666