This code:
void Pack::packUInteger(void **buffer, unsigned int payload){
memcpy(*buffer, &payload, sizeof(unsigned int));
*buffer += sizeof(unsigned int);
}
yields this warning, that I would like to get rid off without telling the compiler to ignore it:
src/messaging/Pack.cpp: In static member function ‘static void Pack::packUInteger(void**, unsigned int)’:
src/messaging/Pack.cpp:33:10: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
*buffer += sizeof(unsigned int);
~~~~~~~~^~~~~~~~~~
I know it should there needs to be a de-referencing and casting, but I can't figure out exactly how to do it correctly.
Thank you internet! :)