I had a little function which converted virtual memory address to physical on a 32-bit architecture:
uint32_t VIRTBASE;
uint32_t getPhysForVirt(void* virt) {
uint32_t offset = (uint8_t*)virt - VIRTBASE;
return PHYSBASE + offset;
}
It compiled and worked without any single issue in last 10+ years.
I've changed the compiler to build the repo for newer architectures (now with 64bit support for the first time).
Compilation fails stating
invalid conversion from ‘uint8_t*’ {aka ‘unsigned char*’} to ‘uint32_t’ {aka ‘unsigned int’} [-fpermissive]
Now, I understand the message, but I'm not sure about the necessary steps to make this compiling without errors.
I'm only sure in that I don't want to enable -fpermissive.