Adding a patch to allow compilation for Yocto architecture
We need to run ECMC on CPUs with Yocto ESS. When trying to enable the linux-corei7-poky
architecture, the compilation failed with the following error:
../devEcmcSup/ethercat/ecmcEcMemMap.cpp: In member function 'int ecmcEcMemMap::validate()':
../devEcmcSup/ethercat/ecmcEcMemMap.cpp:158:19: error: ordered comparison of pointer with integer zero ('uint8_t*' {aka 'unsigned char*'} and 'int')
158 | if ((domainAdr_ < 0) || (domainAdr_ == NULL)) {
| ~~~~~~~~~~~^~~
I could not understand why it is checking if a pointer is less than zero and then check if it's null. Nevertheless, when looking at the most recent version of ECMC (version 9), it seems that this problem is already fixed
So, in order to make our current ECMC (version 8) compatible with Yocto ESS, I added a patch on these lines, making a silly cast to a uint8_t*
. This is harmless and will make the code compile for all architectures. Once we bump ECMC to version 9, this patch won't be necessary anymore.