I stumbled upon a CppCon talk
From 21:15 to 25:00, the speaker claims that the following code is fine in C but undefined behavior in C++:
X* p = (X*)malloc(sizeof(struct X));
p->a = 1;
p->b = 2;
He talked about some rules in C++ Standard that claim that this is UB.
Shouldn't the C be the subset of C++?
And what is the speaker talking about?
I am asking this because there is similar code in handmade hero codebase.