Okay I’ll stop. I’m glad memory safety is a top priority,
@dev Gotta get the string of bytes in place before you can do stuff with it. Kind of interesting that this receives very little attention, because fundamentally many security issues start with an ingestion vulnerability
Fixed
@dev DON'T DON'T DOUBLE FREE ON ME
@dev
CMyShittyClass* p_sc = (CMyShittyClass*)ptr;
std::cout << p_sc->d << "\n";
@dev UNSAFE!! We'll let you keep it but passive aggressively make you feel bad.

@dev One of these things is a dangerous tool that makes it easy to shoot yourself in the foot. The other is a handgun.

One of these things might be regulated by the government?

@dan @dev omg it's the ITAR thing all over again
@dan dan, have you talked to your cats about memory safety
@dev no but they definitely understand undefined behavior
@dan @dev In his really nice work of C traps and pitfalls, Andrew Koenig summarized it: "The C language is like a carving knife: simple, sharp, and extremely useful in skilled hands. Like any sharp tool, C can injure people who don’t know how to handle it."
@Saleh @dan @dev 50 years of experience shows us that C can also injure people who _do_ (or who should) know how to handle it. But so can a carving knife, I guess.
@dan @dev user expected to bring their own foot to shoot at. 🤣
@dev ‘Murica 🦅🇺🇸
@dev it’s catchy, sore, but not sure Gonzales is really what you’re looking for. Or maybe it is (considering what it was really about and who prevailed).
@dev frees it immediately

@dev once long ago, a friend (who was a hardware engineer dabbling in software) asked me to help him with a compiler error. He copy-pasted me the code, and I started looking for the bug, but then a few minutes later he replied saying he'd fixed it. I asked him how he'd solved it, and he told me that he'd changed all the pointers to void.

"That won't fix the problem," I said, "it will just move it to run-time."

He replied, "run-time is overrated".

(He was back a few minutes later)

@dev ah yes, that reminds me of my first job, where the senior dev had decided it was a great idea to pass a void* as a parameter to a function, cast it to a base class that had a bunch of functions called "isDerivedClass1()", "isDerivedClass2()" etc, called each of those until one returned true, cast the void* to the appropriate derived class and then continued handling the object accordingly.

@dev All I want is

ptr + sizeof(void);

Is that too much to ask 🧐

@dev @shac I don’t have to, C has neither type safety nor borrow checking, so I can escape my own via any number of methods.

@dev DON'T TREAD ON MY MEMORY!

(I'm already doing that because I failed to initialize a pointer that I allocated on the stack a few hundred thousand instructions ago, and it was filled with random junk and now I'm indirecting through it. LOL YOLO.)