Type casting errors in V-USB examples

I have started playing around with V-USB and all of the examples type cast a byte array into a void pointer to pass to a struct. I don’t if its because I try compiling this in C++ (Arduino) and it has become illegal, but it returns this error. (I mean the code was written in 2006)


So, is there a way to pass “data” to “rq” here? I am not sure memcpy will work because of padding, right?

Change it to:

  usbRequest_t *rq = (usbRequest_t *)data;

Using void* will work in C, but not in C++.