Thread (5 messages) flat view 5 messages, 4 authors, 2025-08-15

Re: [PATCH net-next] tools: ynl: make ynl.c more c++ friendly

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-08-15 00:05:16
Also in: lkml

On Thu, 14 Aug 2025 16:36:25 -0700 Stanislav Fomichev wrote:
quoted
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.
 
quoted
quoted
@@ -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 *
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help