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 6D91443913; Sun, 18 Feb 2024 15:51:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0CC5C4021D; Sun, 18 Feb 2024 15:51:37 +0100 (CET) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 4F7FD400D5 for ; Sun, 18 Feb 2024 15:51:35 +0100 (CET) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id C5C4C893C for ; Sun, 18 Feb 2024 15:51:34 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id B997B893A; Sun, 18 Feb 2024 15:51:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.4 Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 3413F899D; Sun, 18 Feb 2024 15:51:33 +0100 (CET) Message-ID: <3838403f-af2e-4a2c-b06a-ec4db956d410@lysator.liu.se> Date: Sun, 18 Feb 2024 15:51:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] eal: provide rte attribute macro for GCC attribute Content-Language: en-US To: Thomas Monjalon , Tyler Retzlaff Cc: dev@dpdk.org, =?UTF-8?Q?Mattias_R=C3=B6nnblom?= References: <1708035618-14090-1-git-send-email-roretzla@linux.microsoft.com> <1708035618-14090-2-git-send-email-roretzla@linux.microsoft.com> <3556729.8hb0ThOEGa@thomas> From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: <3556729.8hb0ThOEGa@thomas> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP 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 On 2024-02-18 13:24, Thomas Monjalon wrote: > 15/02/2024 23:20, Tyler Retzlaff: >> Provide a new macro __rte_attribute(a) that when directly used >> compiles to empty for MSVC and to __attribute__(a) when using GCC/LLVM. >> >> Replace direct use of __attribute__ in __rte_xxx macros where there is >> existing empty expansion of the macro for MSVC allowing removal of >> repeated #ifdef RTE_TOOLCHAIN_MSVC per macro to expand empty. > > I'm not sure it makes sense. > I prefer seeing clearly what is empty with MSVC. > > Anything __rte_attribute() is empty on MSVC. You could rename it __rte_attribute_ignored_by_msvc() for clarity. One could note that on the ignore list are things like "may_alias" and "packed", so whatever comes out of a MSVC build should not be expected to actually work. Unless I'm missing something, for all the attributes that will have MSVC-propriety equivalent, the usage pattern would have to change, since the syntax is different in incompatible ways. Wouldn't it be better to ask the MSVC team to add support GCC attributes? ICC and LLVM managed, so why not Microsoft. Then you would solve this issue for all Open Source projects, not only DPDK.