Re: Building rdma-core with -Wcast-qual

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

 



On Thu, Jul 13, 2017 at 03:45:16PM +0300, Sagi Grimberg wrote:
> Hi all,
> 
> When I compile rdma-core with -Wcast-qual I get all sorts of warnings
> on non following const on casts.
> 
> Does/should anyone care?

I looked at this once.. It gets really hard to do const correctness in
C..

Eg, how do you handle this:

#define container_of(ptr, type, member) \
	((type *) ((uint8_t *)(ptr) - offsetof(type, member)))

if ptr is a const then it has to be:

#define container_of(ptr, type, member) \
	((const type *) ((const uint8_t *)(ptr) - offsetof(type, member)))

Similar issue for the ccan list macros.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux