From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 221CBA034C;
	Wed, 16 Feb 2022 12:01:09 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id EC17B410FF;
	Wed, 16 Feb 2022 12:01:08 +0100 (CET)
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by mails.dpdk.org (Postfix) with ESMTP id 67D97410FB
 for <dev@dpdk.org>; Wed, 16 Feb 2022 12:01:07 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
 t=1645009267; x=1676545267;
 h=date:from:to:cc:subject:message-id:references:
 mime-version:in-reply-to;
 bh=rpbtQJq9rfv5iuPuaTDPjl6mh1LxOO6K7W9dFDHZp2s=;
 b=CXFeQgHYS2taf/420biST6s5TJtFakiQb8NE/j8a+kGOKQdwxQ3bNT1L
 VioJhY6O+fTKPdkkEC8T2Cx43SsST4wYAHCshjCg6Bgu+wZZlPtCXRc2N
 QESc0bxKxhTBzaNR7jZpM1z6OukPTCCWzr1GHdFf4WAQfM3nMFmcQYBDG
 Ll/fxCiU6gQ0LeO3BZWKlBpwo4OL8TYa0t30A0AQsxHWL1Rh5O3QB9/f1
 XuxXIPxh1sHvQs7IDf1dLXuWUVm+4teBtrm8Jxw+/TOKWS92puLMSvWiJ
 TrX7Qv+VRNNZ7H0pjYfk/LcRyTFDJclmG9XIfLUK6NGlaPhBrsvJn0rcz g==;
X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="248176985"
X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="248176985"
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 16 Feb 2022 03:01:06 -0800
X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="704262252"
Received: from bricha3-mobl.ger.corp.intel.com ([10.252.21.192])
 by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA;
 16 Feb 2022 03:01:04 -0800
Date: Wed, 16 Feb 2022 11:01:01 +0000
From: Bruce Richardson <bruce.richardson@intel.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
 Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH 1/3] ethdev: fix missing cast for C++ compatibility
Message-ID: <YgzZbScY9l/YoQIj@bricha3-MOBL.ger.corp.intel.com>
References: <20220215173029.1893710-1-bruce.richardson@intel.com>
 <20220215173029.1893710-2-bruce.richardson@intel.com>
 <69adf34b-6914-8b54-b35b-c968d72a1b33@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <69adf34b-6914-8b54-b35b-c968d72a1b33@intel.com>
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On Wed, Feb 16, 2022 at 10:32:43AM +0000, Ferruh Yigit wrote:
> On 2/15/2022 5:30 PM, Bruce Richardson wrote:
> > C++ does not allow implicit conversion to/from void*, so we need an
> > explicit cast to allow the driver sdk header to be included from C++
> > code.
> > 
> 
> I remember patches removing explicit "void *" cast, in the past,
> 
> to document, is the rule as following:
> - public and sdk headers should support c++, hence these files
>   must have explicit "void *" cast
> - .c files should NOT have explicit "void *" cast
> 
That would be my understanding yes. It's annoying they conflict, so I would
suggest softening the second rule to allow casts to be present. Thankfully
with chkincs support we should be able to detect violations of rule #1,
which is the more important of the two.

/Bruce