[PATCH v3 0/5] Improve EAL bit operations API
Mattias Rönnblom
hofors at lysator.liu.se
Mon Sep 9 15:09:10 CEST 2024
On 2024-09-09 14:25, David Marchand wrote:
> On Mon, Sep 9, 2024 at 2:05 PM Mattias Rönnblom <hofors at lysator.liu.se> 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 <rte_foo.h>
>>
>> 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 <rte_foo.h>
>>
>> #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.
>
>
More information about the dev
mailing list