Skip to content
DevMeme
4235 of 7590
LowLevelProgramming Post #4630 · source on Telegram

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

33
Anonymous ★ Top Pick Fifteen architecture reviews later, the “extensible plugin framework” is still a single global void *empty; - apparently undefined behaviour is the most scalable abstraction
  1. Anonymous ★ Top Pick

    Fifteen architecture reviews later, the “extensible plugin framework” is still a single global void *empty; - apparently undefined behaviour is the most scalable abstraction

  2. Anonymous

    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'

  3. Anonymous

    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

  4. Anonymous

    Dereference that void*, and the void dereferences your stack trace right back

  5. Anonymous

    void* empty; - the event horizon of our ABI where every type crosses and type safety never returns

  6. Anonymous

    void* is the black hole of type systems - everything fits until invariants spaghettify into a 3am segfault

  7. Deleted Account 4y

    void*

  8. @sylfn 4y

    fixed

    1. @cptnBoku 4y

      Bruh

    2. @callofvoid0 4y

      exactly me

  9. @AlexKart20129 4y

    void *empty=nullptr;

  10. @RiedleroD 4y

    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.

    1. @sylfn 4y

      you cant dereference references, only pointers

      1. @RiedleroD 4y

        …why?

        1. @beton_kruglosu_totchno 4y

          are you joking?

          1. @RiedleroD 4y

            I'm a beginner at C++, give me some slack

            1. @beton_kruglosu_totchno 4y

              references are transparent pointers, you do not dereference them, you just use them

              1. @RiedleroD 4y

                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.

                1. @beton_kruglosu_totchno 4y

                  give us MCVE please :3

        2. @sylfn 4y

          references work as pointers but autodereferenced

          1. @RiedleroD 4y

            ok so why didn't it let me put a uint8_t& into a function that needed a uint8_t*?

            1. @beton_kruglosu_totchno 4y

              because reference is basically same as the value it references

    2. @beton_kruglosu_totchno 4y

      also, there cannot be a pointer to reference, so you are talking about reference to pointer

      1. @RiedleroD 4y

        right, sorry. It was an uint8_t&*.

        1. @RiedleroD 4y

          I think.

        2. @sylfn 4y

          this is pointer to reference i think, and is disallowed

        3. @beton_kruglosu_totchno 4y

          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

      2. @sylfn 4y

        but why there is no "array of references"

  11. @SamsonovAnton 4y

    int** 0x3f800001 SIGBUS¹ ¹ On architectures that totally disallow unaligned access, like SPARC.

    1. @kulikov0 4y

      *cpp developer

      1. @sylfn 4y

        you can touch yourself!

        1. @kulikov0 4y

          Well, I'm in

  12. @hekary715 4y

    😳

Use J and K for navigation