Hi Chris,
as already mentioned in the previous thread about the drotek driver:
I don't know how to get rid off that diagnostic warning, as I'm pretty sure the code is correct:
The
i2c_trans.buf is marked volatile. If the explicit cast to void* is omitted, it will warn that the volatile attribute is discarded... so the volatile qualifier of the buf is explicitly cast away, since we know that here memcpy is only called when the transaction is done and the contents of the buf actually won't change anymore.
If anyone can shed some more light on this, it would be appreciated.
Also when checking this again I noticed that we currently don't have -Wcast-qual enabled for the stm32 platform, so that is why you won't see the warning there.
Cheers, Felix