paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] compile warning when i use the drotek 10dof imu


From: Felix Ruess
Subject: Re: [Paparazzi-devel] compile warning when i use the drotek 10dof imu
Date: Sun, 8 Sep 2013 21:14:17 +0200

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:
memcpy(mpu->data_ext, (void *) &(mpu->i2c_trans.buf[15]), mpu->config.nb_bytes - 15);

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


On Sun, Sep 8, 2013 at 7:39 PM, Chris <address@hidden> wrote:
Hi.
I get this warning which i wasn't getting before when i use the newest master (just did an update)
and the drotek 10dof imu subsystem:

peripherals/mpu60x0_i2c.c: In function 'mpu60x0_i2c_event':
peripherals/mpu60x0_i2c.c:100:33: warning: cast discards '__attribute__((noreturn))' qualifier from pointer target type [-Wcast-qual]

Chris


_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]