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 57BC94594A; Mon, 9 Sep 2024 15:09:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 149F740E31; Mon, 9 Sep 2024 15:09:15 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id B450F40299 for ; Mon, 9 Sep 2024 15:09:13 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 719DD172C7 for ; Mon, 9 Sep 2024 15:09:13 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 64ECB17340; Mon, 9 Sep 2024 15:09:13 +0200 (CEST) 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.2 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.2 Received: from [192.168.1.86] (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 42CFC173B3; Mon, 9 Sep 2024 15:09:11 +0200 (CEST) Message-ID: <0f830934-cfb6-4a5d-8c5f-a804710b17ca@lysator.liu.se> Date: Mon, 9 Sep 2024 15:09:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/5] Improve EAL bit operations API To: David Marchand Cc: Tyler Retzlaff , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , dev@dpdk.org, Heng Wang , Stephen Hemminger , =?UTF-8?Q?Morten_Br=C3=B8rup?= , Jack Bond-Preston , Thomas Monjalon References: <20240809095829.589396-2-mattias.ronnblom@ericsson.com> <20240812124930.604796-1-mattias.ronnblom@ericsson.com> <6f228b70-8b85-4a91-965d-2b99658c668e@lysator.liu.se> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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-09-09 14:25, David Marchand wrote: > On Mon, Sep 9, 2024 at 2:05 PM Mattias Rönnblom wrote: >>> Mattias, there are issues reported by the CI (compilation on Ubuntu >>> 22.04 in GHA, and unit test failure in UNH), please have a look. >>> >>> >> >> Standard practice in DPDK header files is the following: >> >> -- >> /* rte_bar.h */ >> #ifdef __cplusplus >> extern "C" { >> #endif >> >> #include >> >> void >> rte_foo_do(void); >> >> /../ >> -- >> >> That seems not like best practice to me, since rte_bar.h is messing >> around with linkage of constructs of any files included. In particular, >> it prohibits replacing _Generic with C++ function overloading, in C++ TUs. >> >> What one should do is to have extern "C" linkage only on functions which >> the include file in question (e.g., rte_foo.h) itself declares. > > This is probably not the best practice, but since you intend to fix > it, it will be perfect afterwards :-). > Actually, I intended to opt for a less-than-perfect solution, where you just move the 'extern "C"' to cover everything but includes, rather than just what is necessary (i.e., functions and global variables). That change was easily automated, but the perfect solution requires a more elaborate script or human intervention. > >> >> -- >> /* rte_bar.h */ >> #include >> >> #ifdef __cplusplus >> extern "C" { >> #endif >> >> void >> rte_foo_do(void); >> >> /../ >> -- >> >> There are 259 header files in the DPDK repo in need of fixing. >> >> Should the fix be 259 patches, or something smaller? One large patch, or >> a patch per library, or something else. Please advise, over. > > The change seems mechanical, so one single change is ok. > >