When your C code just stares into the void pointer abyss
Description
A dark-mode meme shows a Wojak-style line-art figure on the right, sketched in white against a solid black background, with its arm outstretched and index finger pointing left. Floating on the left side is a perfectly round, pitch-black circle that visually represents absolute nothingness. Center-top, rendered in a light-blue monospace font, the exact code snippet "void *empty;" appears, declaring a void pointer named "empty". The joke riffs on low-level C programming: a void* can point to any type yet, if left unassigned, it literally points to the void - invoking memories of null dereferences, undefined behaviour, and manual memory-management dread familiar to systems engineers
Comments
33Comment deleted
Fifteen architecture reviews later, the “extensible plugin framework” is still a single global void *empty; - apparently undefined behaviour is the most scalable abstraction
After 20 years in the industry, I've learned that void pointers aren't just type-erased memory addresses - they're portals to the shadow realm where your debugger fears to tread and valgrind whispers 'definitely lost: 8 bytes in 1 blocks'
When you dereference that void pointer at 3 AM and realize you've been staring into the abyss of uninitialized memory - and the abyss segfaults back. The real horror isn't the undefined behavior; it's explaining to the on-call team why production went down because someone thought 'void *empty' was just a philosophical statement, not a ticking time bomb waiting for that inevitable NULL check you forgot to write
Dereference that void*, and the void dereferences your stack trace right back
void* empty; - the event horizon of our ABI where every type crosses and type safety never returns
void* is the black hole of type systems - everything fits until invariants spaghettify into a 3am segfault
void* Comment deleted
fixed Comment deleted
Bruh Comment deleted
exactly me Comment deleted
void *empty=nullptr; Comment deleted
recently i had a uint8_t*& and I didn't like it. dereferencing yielded a uint8_t&. Dereferencing twice yielded an exception about how I can't dereference an uint8_t. I'm tired. Comment deleted
you cant dereference references, only pointers Comment deleted
…why? Comment deleted
are you joking? Comment deleted
I'm a beginner at C++, give me some slack Comment deleted
references are transparent pointers, you do not dereference them, you just use them Comment deleted
I didn't even mean to use references. I specifically asked for an uint8_t* to be passed into my function and C++ just gave me an uint8_t*& instead. Comment deleted
give us MCVE please :3 Comment deleted
references work as pointers but autodereferenced Comment deleted
ok so why didn't it let me put a uint8_t& into a function that needed a uint8_t*? Comment deleted
because reference is basically same as the value it references Comment deleted
also, there cannot be a pointer to reference, so you are talking about reference to pointer Comment deleted
right, sorry. It was an uint8_t&*. Comment deleted
I think. Comment deleted
this is pointer to reference i think, and is disallowed Comment deleted
I do not really remember how the types are written so maybe you named it correctly first time I just want to clarify that pointer to references do not exist because reference is supposed to be a compile time abstraction with potentially no runtime storage Comment deleted
but why there is no "array of references" Comment deleted
int** 0x3f800001 SIGBUS¹ ¹ On architectures that totally disallow unaligned access, like SPARC. Comment deleted
*cpp developer Comment deleted
you can touch yourself! Comment deleted
Well, I'm in Comment deleted
😳 Comment deleted