From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F4008A09E4; Thu, 28 Jan 2021 16:16:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71B224067A; Thu, 28 Jan 2021 16:16:58 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 9FE9440395; Thu, 28 Jan 2021 16:16:55 +0100 (CET) IronPort-SDR: aFxHVjE2BYqDmG69e/hXvfx91sq6EuzzCBVgiNp8G1r7n9JyGlVnSBO1VEStxPLhLe8yI3eEfj HR52IRZrfLIw== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="176741002" X-IronPort-AV: E=Sophos;i="5.79,382,1602572400"; d="scan'208";a="176741002" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 07:16:54 -0800 IronPort-SDR: WES11DaYIVA4Af7K+WgBZEq7EH/E2P3IJhQdHnFJCgFfdxLnh81+N5mtBY7IuyvCiY97PYYpjD H0j1iiFBNr8Q== X-IronPort-AV: E=Sophos;i="5.79,382,1602572400"; d="scan'208";a="369887117" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.11.53]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 28 Jan 2021 07:16:52 -0800 Date: Thu, 28 Jan 2021 15:16:49 +0000 From: Bruce Richardson To: David Marchand , techboard@dpdk.org Cc: dev Message-ID: <20210128151649.GJ899@bricha3-MOBL.ger.corp.intel.com> References: <20210114110606.21142-1-bruce.richardson@intel.com> <20210127173330.1671341-1-bruce.richardson@intel.com> <20210127173330.1671341-3-bruce.richardson@intel.com> <20210128112007.GA899@bricha3-MOBL.ger.corp.intel.com> <20210128141610.GI899@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210128141610.GI899@bricha3-MOBL.ger.corp.intel.com> Subject: Re: [dpdk-dev] [PATCH v6 2/8] eal: fix error attribute use for clang X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jan 28, 2021 at 02:16:10PM +0000, Bruce Richardson wrote: > On Thu, Jan 28, 2021 at 02:36:25PM +0100, David Marchand wrote: > > On Thu, Jan 28, 2021 at 12:20 PM Bruce Richardson > > wrote: > > > > If the compiler has neither error or diagnose_if support, an internal > > > > API can be called without ALLOW_INTERNAL_API. > > > > I prefer a build error complaining on an unknown attribute rather than > > > > silence a check. > > > > > > > > I.e. > > > > > > > > #ifndef ALLOW_INTERNAL_API > > > > > > > > #if __has_attribute(diagnose_if) /* For clang */ > > > > #define __rte_internal \ > > > > __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ > > > > section(".text.internal"))) > > > > > > > > #else > > > > #define __rte_internal \ > > > > __attribute__((error("Symbol is not public ABI"), \ > > > > section(".text.internal"))) > > > > > > > > #endif > > > > > > > > #else /* ALLOW_INTERNAL_API */ > > > > > > > > #define __rte_internal \ > > > > section(".text.internal"))) > > > > > > > > #endif > > > > > > > > > > Would this not mean that if someone was using a compiler that supported > > > neither that they could never include any header file which contained any > > > internal functions? I'd rather err on the side of allowing this, on the > > > basis that the symbol should be already documented as internal and this is > > > only an additional sanity check. > > > > - Still not a fan. > > We will never know about those compilers behavior, like how we caught > > the clang issue and found an alternative. > > > > So I understand, but I'm still concerned about breaking something that was > previously working. It's one thing a DPDK developer catching issues with > clang, quite another a user catching it when trying to build their own > application. > > We probably need some other opinions on this one. > Adding Tech-board to see if we can get some more thoughts on this before I do another revision of this set.