public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: Building rdma-core with -Wcast-qual
Date: Thu, 13 Jul 2017 16:29:59 -0600	[thread overview]
Message-ID: <20170713222959.GB10088@obsidianresearch.com> (raw)
In-Reply-To: <ed258438-d585-d0ee-6c56-0178c589406b-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>

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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2017-07-13 22:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 12:45 Building rdma-core with -Wcast-qual Sagi Grimberg
     [not found] ` <ed258438-d585-d0ee-6c56-0178c589406b-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2017-07-13 13:41   ` Leon Romanovsky
2017-07-13 22:29   ` Jason Gunthorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170713222959.GB10088@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox