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 AA52743801; Wed, 3 Jan 2024 00:45:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2FC8B402F0; Wed, 3 Jan 2024 00:45:08 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 15635402D8 for ; Wed, 3 Jan 2024 00:45:04 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 46DE820ACEEC; Tue, 2 Jan 2024 15:45:03 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 46DE820ACEEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1704239103; bh=mNX0HhYkYfM/XwpdVXSqWKKBU92WonGrCdwxOg/TDss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=baVcH5qFniO2HoQ/EVf9O0+39X0k2TvKE+jr83mVY1Gf0ByyTIN5HDnuyVGW1zC4t VgW+5PxavjpI3vrAtBY0hwpKCbfHtNO4pM1sS8R8HlOjV9PVRnA5byZIdABJdL2XSj WWwacCBnhZDeGvtG4iwY7cAcTd+NCLLcbGdtMytY= From: Tyler Retzlaff To: dev@dpdk.org Cc: Kai Ji , Pablo de Lara , Tyler Retzlaff Subject: [PATCH v2 3/3] eal: remove typeof from per lcore macros Date: Tue, 2 Jan 2024 15:45:02 -0800 Message-Id: <1704239102-31044-4-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1704239102-31044-1-git-send-email-roretzla@linux.microsoft.com> References: <1703006864-27378-1-git-send-email-roretzla@linux.microsoft.com> <1704239102-31044-1-git-send-email-roretzla@linux.microsoft.com> 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 The design of the macros requires a type to be provided to the macro. By expanding the type parameter inside of typeof it also inadvertently allows an expression to be used which appears not to have been intended after evaluating the parameter name and existing macro use. Technically this is an API break but only for applications that were using these macros outside of the original design intent. Signed-off-by: Tyler Retzlaff --- lib/eal/include/rte_per_lcore.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/eal/include/rte_per_lcore.h b/lib/eal/include/rte_per_lcore.h index 41fe1f0..529995e 100644 --- a/lib/eal/include/rte_per_lcore.h +++ b/lib/eal/include/rte_per_lcore.h @@ -24,10 +24,10 @@ #ifdef RTE_TOOLCHAIN_MSVC #define RTE_DEFINE_PER_LCORE(type, name) \ - __declspec(thread) typeof(type) per_lcore_##name + __declspec(thread) type per_lcore_##name #define RTE_DECLARE_PER_LCORE(type, name) \ - extern __declspec(thread) typeof(type) per_lcore_##name + extern __declspec(thread) type per_lcore_##name #else /** * Macro to define a per lcore variable "var" of type "type", don't @@ -35,13 +35,13 @@ * whole macro. */ #define RTE_DEFINE_PER_LCORE(type, name) \ - __thread __typeof__(type) per_lcore_##name + __thread type per_lcore_##name /** * Macro to declare an extern per lcore variable "var" of type "type" */ #define RTE_DECLARE_PER_LCORE(type, name) \ - extern __thread __typeof__(type) per_lcore_##name + extern __thread type per_lcore_##name #endif /** -- 1.8.3.1