From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: including sparse headers in C++ code Date: Mon, 11 Oct 2010 23:46:56 +0100 Message-ID: <20101011224656.GN19804@ZenIV.linux.org.uk> References: <20101009205930.GA4684@feather> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:37446 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756672Ab0JKWq7 (ORCPT ); Mon, 11 Oct 2010 18:46:59 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Tomas Klacko Cc: Christopher Li , Josh Triplett , linux-sparse@vger.kernel.org On Tue, Oct 12, 2010 at 12:33:32AM +0200, Tomas Klacko wrote: > Great. I am posting my current status (as a patch) so that you can comment on it > and that I can refine it further. ehh... Use of capitalized variable names is a Bad Idea(tm). Especially since you are doing that well outside of headers, so even compatibility with Straustrups's Mistake does not serve as a reason. > -#define CHECK_TYPE(head,ptr) (void)(&(ptr) == &(head)->list[0]) > +#define CHECK_TYPE(head,ptr) (void)((void*)&(ptr) == (void*)&(head)->list[0]) WTF? You do realize that it defeats the only purpose of this thing?