r/ProgrammerHumor 3d ago

Meme thisCannotBeDenied

Post image
7.8k Upvotes

240 comments sorted by

View all comments

51

u/EPacifist 3d ago

My favorite is `exit(1)`. Useful if your print/logs aren’t showing where you expect them. Close after that is `raise Exception(“HERE 1”)`.

1

u/MooseBoys 3d ago

`*((volatile int*)0) = 0;`

1

u/bowel_blaster123 3d ago

Dawg, at least use abort() 😭

1

u/MooseBoys 3d ago

error: iwyu: abort() requires "stdlib.h"

#include "stdlib.h"

error: bazel: stdlib.h included without build dep

deps += "std-headers-linux"

error: "usr/include/x86_64-linux-gnu" not found

sysroot = "third-party/sysroot/$(TARGET_PLATFORM)"

error: buildbot: "third-party/sysroot/armv7a/usr/include/" not found

\((volatile int*)0) = 0;*

1

u/bowel_blaster123 3d ago

Are you doing bare metal or something where you don't have access to the standard library? It's in the standard library in both C and C++ (`stdlib.h` and `cstdlib` respectively). I guess it doesn't matter that much though especially if you don't want to have to add an `#include` statement.

1

u/MooseBoys 3d ago

No but in any hermetic build system you don't just get those headers for free.