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 EFEA9A0544; Thu, 22 Sep 2022 22:54:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F4BB40150; Thu, 22 Sep 2022 22:54:41 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id C4474400D7 for ; Thu, 22 Sep 2022 22:54:39 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v3] eal: Pointer alignment check improvements Date: Thu, 22 Sep 2022 22:54:38 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87351@smartserver.smartshare.dk> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v3] eal: Pointer alignment check improvements Thread-Index: AdjOiKahpETNT3qUTbWh8inl6PjWWQAOwdnA References: <98CBD80474FA8B44BF855DF32C47DC35D8734D@smartserver.smartshare.dk> <20220922132730.5178-1-mb@smartsharesystems.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Bruce Richardson" Cc: , , 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 > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > Sent: Thursday, 22 September 2022 15.39 >=20 > On Thu, Sep 22, 2022 at 03:27:30PM +0200, Morten Br=F8rup wrote: > > Checking a const pointer for alignment would emit a warning about = the > > const qualifier being discarded. > > > > No need to calculate the aligned pointer; just check the last bits = of > the > > pointer. > > > > v3: > > - Make the uintptr_t const to avoid potential future warnings. > (Bruce) > > v2: > > - Remove compiler attribute ((const)) from function; > > it was a coding style issue. > > > > Signed-off-by: Morten Br=F8rup >=20 > Acked-by: Bruce Richardson >=20 > Or perhaps it should be "Const-acked-by: ... " :-) Unfortunately not as const as expected by both of us... The v3 build fails at github [1] with: ../lib/eal/include/rte_common.h: In function 'int rte_is_aligned(const = void*, unsigned int)': ../lib/eal/include/rte_common.h:409:27: error: type qualifiers ignored = on cast result type [-Werror=3Dignored-qualifiers] 409 | return ((const uintptr_t)ptr & (align - 1)) =3D=3D 0; | ^~~ [1] = http://mails.dpdk.org/archives/test-report/2022-September/308604.html I don't understand what the problem is, so my solution is omitting the = const, i.e. rolling back to v2, which doesn't fail building. Unless you = can suggest a better solution, Bruce? I have changed v2 status in Patchwork back to New and v3 to Superseded. -Morten