in my function, I allocate memory and populate a structure called messagePacket
struct messagePacket *packet = malloc(sizeof(struct messagePacket));
When I try to direct the pointer as (uint8_t *), gcc issues a warning saying: the large integer is implicitly truncated to an unsigned type
sendBuf(..., (uint8_t *)packet);
I was able to do the following just fine, and I understand that I can use this approach as a workaround. I am here because I would rather learn from this, besides working around him.
uint8_t *buf = malloc(sizeof(struct messagePacket));
The size of the struct messagePacket = 1209 B. My best guess is that the chunk of memory is super-large, which I store in a high memory address such as the 16th address? But this does not correspond to the fact that I can malloc uint8_t * of the same size.
source