I just updated to V11.2.0 and got this warning:
[C] port.c
/Users/simon/Developer/FreeRTOS-Ada/FreeRTOS-Kernel/portable/GCC/RISC-V/port.c: In function 'vPortSetupTimerInterrupt':
/Users/simon/Developer/FreeRTOS-Ada/FreeRTOS-Kernel/portable/GCC/RISC-V/port.c:139:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
139 | pullMachineTimerCompareRegister = ( volatile uint64_t * ) ( ullMachineTimerCompareRegisterBase + ( ulHartId * sizeof( uint64_t ) ) );
| ^
This is with GCC 14.2.0 cross-compiling on aarch64-apple-darwin to -march=rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb -mabi=ilp32
.
Looking at the code I don’t see quite what the compiler is complaining about, unless it’s the ulHartId
. Perhaps it’s because pointers on this architecture are 32 bits, so uint64_t const ullMachineTimerCompareRegisterBase
at :93 should in fact be uint32_t const ulMachineTimerCompareRegisterBase
? That certainly silences the warning.
This is the opposite of issue #189. Are there techniques to check for 64- vs 32-bits?