lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fa3700a0-dfdb-4861-82f7-1512374c2cd7@intel.com>
Date: Thu, 14 Aug 2025 14:29:23 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Stanislav Fomichev <sdf@...ichev.me>, <netdev@...r.kernel.org>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <donald.hunter@...il.com>, <horms@...nel.org>,
	<jstancek@...hat.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] tools: ynl: make ynl.c more c++ friendly



On 8/14/2025 9:44 AM, Stanislav Fomichev wrote:
> Compiling ynl.c in a C++ code base requires invoking C compiler and
> using extern "C" for the headers. To make it easier, we can add
> small changes to the ynl.c file to make it palatable to the native
> C++ compiler. The changes are:
> - avoid using void* pointer arithmetic, use char* instead
> - avoid implicit void* type casts, add c-style explicit casts
> - avoid implicit int->enum type casts, add c-style explicit casts
> - avoid anonymous structs (for type casts)
> - namespacify cpp version, this should let us compile both ynl.c
>   as c and ynl.c as cpp in the same binary (YNL_CPP can be used
>   to enable/disable namespacing)
> 

The changes seem ok to me. Obviously these violate several of the usual
kernel style guidelines.. But this is a library which has a lot more
reason to be compiled with C++.

> Also add test_cpp rule to make sure ynl.c won't break C++ in the future.
> 
Thanks. Is this run in some part of automation so we can catch issues
from future patches? Ah. I see it is run as part of the normal "all"
target. Ok.

Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>


Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ