On 17/12/24 10:04, Alexander Lobakin wrote:
From: Gustavo A. R. Silva <gust...@embeddedor.com>
Date: Tue, 17 Dec 2024 09:58:28 -0600



On 17/12/24 08:55, Alexander Lobakin wrote:
From: Kees Cook <k...@kernel.org>
Date: Mon, 16 Dec 2024 18:59:55 -0800

This switches to using a manually constructed form of struct tagging
to avoid issues with C++ being unable to parse tagged structs within
anonymous unions, even under 'extern "C"':

    ../linux/include/uapi/linux/pkt_cls.h:25124: error: ‘struct
tc_u32_sel::<unnamed union>::tc_u32_sel_hdr,’ invalid; an anonymous
union may only have public non-static data members [-fpermissive]

I worked around that like this in the past: [0]
As I'm not sure it would be fine to fix every such occurrence manually
by open-coding.
What do you think?

The thing is that, in this particular case, we need a struct tag to change
the type of an object in another struct. See:

But the fix I mentioned still allows you to specify a tag in C code...
cxgb4 is for sure not C++.


Oh yes, I see what you mean. If it works, then you should probably submit that
patch upstream. :)

Thanks
--
Gustavo

Reply via email to