I'm unsure how to fix the warning for this piece of code (warning pertains to the second line). This is not my code but it does work perfectly. However, I'd like to get rid of the warning but am confused. v is an unsigned long that we want to put to pointer. We are working with avr-gcc.
../../uJ/uj.c:1149:20: warning: initialization from incompatible pointer type const UInt8* d = &v;
static void ujThreadPrvPut32(UInt8* ptr, UInt32 v){ //to pointer
const UInt8* d = &v;
*ptr++ = *d++;
*ptr++ = *d++;
*ptr++ = *d++;
*ptr = *d;
}
Add a cast:
const UInt8* d = (const UInt8*)&v;