Thread (17 messages) 17 messages, 5 authors, 2024-08-23

Re: arch_prctl()

From: Alejandro Colomar <alx@kernel.org>
Date: 2024-08-23 12:19:28

Hi Xi,

On Fri, Aug 23, 2024 at 03:35:39PM GMT, Xi Ruoyao wrote:
On Thu, 2024-08-22 at 21:24 +0200, Alejandro Colomar wrote:
quoted
quoted
...except transparent unions are C-only, so we'd need something else
for C++ if we went with this for C.
Why don't they have transparent unions in C++?  Is it just that nobody
cared to implement them?  Or do they have inherent problems there?
In C++ you can write something like

union X {
	int x;
	float y;

	X(int _x) : x(_x) {}
	X(float _y) : y(_y) {}
};

anyway.
But by not having transparent unions, C++ will reject valid C code.
This ultimately means that C++ won't be able to include a header that
provides arch_prctl(2).

Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es/>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help