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 C796F438E6; Wed, 17 Jan 2024 09:07:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4532402B0; Wed, 17 Jan 2024 09:07:51 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 2DC5A402A6 for ; Wed, 17 Jan 2024 09:07:50 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id AB1E559; Wed, 17 Jan 2024 11:07:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru AB1E559 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1705478869; bh=mlxRTrjCvAFM+OubV05ix/hi0y90OE6TMADyD0dSEXw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=UtYKDWR5Y56rEEMyq5GZ+hxW/2+hV6wBlq9fW7UxdO0Rl1JYIPRGGY132mXlSOAS+ icPwIZ2mGul0slnVLj1ECeWaWrZJmV/zLQJyL1YNOem6c7FARknWqr9cCFz8zEtsSB Z3lwLa1eDzmbspSbRm+0SE033Cvzr9nNXrLirPMA= Message-ID: Date: Wed, 17 Jan 2024 11:07:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: static_assert, sfc, and clang issues Content-Language: en-US To: Stephen Hemminger , =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: Tyler Retzlaff , dev@dpdk.org References: <20240116090301.4c29d5b7@hermes.local> <20240116215034.GA351@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <98CBD80474FA8B44BF855DF32C47DC35E9F169@smartserver.smartshare.dk> <20240116144952.3614593f@hermes.local> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20240116144952.3614593f@hermes.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 1/17/24 01:49, Stephen Hemminger wrote: > On Tue, 16 Jan 2024 23:14:36 +0100 > Morten Brørup wrote: > >>> +1 for #2 just make it a block. >> >> I prefer that you implement the workaround in the RTE_BUILD_BUG_ON() macro, by surrounding it by "do { } while (0)", like this: >> >> #define RTE_BUILD_BUG_ON(condition) do { static_assert(!(condition), #condition); } while (0) >> >> And please mention the workaround reason, with the reference to the clang bug, in the source code comment describing the function. >> >> The godbolt link in the clang issue seems happy with this workaround. > > In the patch series sent, already did that. Didn't need to do { } while(0) hack to make it work. > Reference is in commit message. I'm OK with the solution in the patch series. Thanks a lot.