From: Jakub Kicinski <kuba@kernel.org>
To: Stanislav Fomichev <stfomichev@gmail.com>
Cc: Stanislav Fomichev <sdf@fomichev.me>,
netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, donald.hunter@gmail.com, horms@kernel.org,
jstancek@redhat.com, jacob.e.keller@intel.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] tools: ynl: make ynl.c more c++ friendly
Date: Thu, 14 Aug 2025 17:05:14 -0700 [thread overview]
Message-ID: <20250814170514.3fb6e690@kernel.org> (raw)
In-Reply-To: <aJ5y-WWCZAlJ9QUy@mini-arch>
On Thu, 14 Aug 2025 16:36:25 -0700 Stanislav Fomichev wrote:
> > As I mentioned in person, ynl-cpp is a separate thing, and you'd all
> > benefit from making it more C++ than going the other way and massaging
> > YNL C.
> >
> > With that said, commenting below on the few that I think would be okay.
>
> Ok, and the rest (typecasts mostly and the namespace) - you're not supper
> happy about? I can drop that test_cpp if that helps :-)
No, they are illogical from C's standpoint :(
I really don't get the need for the adjustments, the code generator is
obviously different for C++, and that's a major effort. The ynl.c casts
are trivial in comparison.
> > > @@ -149,7 +153,7 @@ ynl_err_walk(struct ynl_sock *ys, void *start, void *end, unsigned int off,
> > > return n;
> > > }
> > >
> > > - data_len = end - start;
> > > + data_len = (char *)end - (char *)start;
> >
> > can we make the arguments char * instead of the casts?
>
> Let me try. That might require to char-ify helpers like ynl_nlmsg_data_offset
> and ynl_nlmsg_end_addr.
Hm, then probably let's leave it as void *
prev parent reply other threads:[~2025-08-15 0:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 16:44 [PATCH net-next] tools: ynl: make ynl.c more c++ friendly Stanislav Fomichev
2025-08-14 21:29 ` Jacob Keller
2025-08-14 22:27 ` Jakub Kicinski
2025-08-14 23:36 ` Stanislav Fomichev
2025-08-15 0:05 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250814170514.3fb6e690@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=jstancek@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=stfomichev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox